Hello,
I have a record action which shows "Add comment" and after completing/adding the comment details the record action should get updated to database or record. But it is not refreshing dashboard or interface. Only after page refresh page only it's refreshing but not immediately after the action submission.
a!columnLayout( contents: { a!recordActionField( actions: a!recordActionItem( action: 'recordType!{6d2a7f52-9952-4737-bb95-d3f3a29c06ac}PIMS Project Details.actions.{4e341a40-54be-42c6-ac1e-7e52004c1fca}comment', identifier: ri!projectDetails['recordType!{6d2a7f52-9952-4737-bb95-d3f3a29c06ac}PIMS Project Details.fields.{dedeac6d-7da7-4635-82db-b4816e2daa36}projectId'] ), style: "SIDEBAR_PRIMARY", display: "LABEL" ), },
Thanks,
Chiranjeevi
Discussion posts and replies are publicly visible
Can you confirm if the process has activity chaining till the write records node?
Yes, I am using the activity changing as well as. still not refreshing the dashboard.
local!commentsHistory: a!refreshVariable( value: rule!xxxxx( projectId: ri!projectId, roleId: cons!xxx_PROJECT_ROLES[1], pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 5000, sort: a!sortInfo( field: 'recordType!{02a27db2-7e89-498c-a3f9-4d645bbd9162}PIMS Project Comments.fields.{019ef13f-c369-4923-8b92-6dbae9a5d5b6}createdDatetime', ascending: false ) ) ).data, refreshAfter:"RECORD_ACTION" ),
So far it all look fine. There shouldnt be any issue. This same variable commentHistory is used to render the grid right? Are there any manipulations done to this further in your code somewhere?
Harsha Sharma
Same variable I am using the further.
In that case, with the details we have so far I can't point what might be causing this refresh behaviour. Something between interface and process is causing this. To identify the cause, if I were you, I will call the rule directly on data of grid component or simplify the interface by commenting everything else except the field under investigation and then uncomment as works again! You can share with us interface structure if possible like is the record action and comment grid all in same UI, more code the better,
or else dissect your code line by line until you achieve the desired output. All the best!
Just to be sure, could you share how the variable commentHistory is being used?
Are you using any local variables within "rule!xxxxx(" (your query for local!commentsHistory)?
Mike Schmitt
you mean to say filters. I am using local variable, right?
Chiranjeevi Ghantasala said:you mean to say filters.
No. I'm asking what the code in your expression rule is, and if you're using any local variables within it. Any local variables at all - i'm not talking about filters in particular at all.
please make sure you have also used refreshVariable inside the rule what ever is used inside the local variable local!commentsHistory. As that rule refreshes it should also have same definition for local variable inside the rule.
a!queryRecordType( recordType: 'recordType!{02a27db2-7e89-498c}XXX Project Comments', fields: { if( a!isNullOrEmpty(ri!selection), {}, ri!selection ) }, filters: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: 'recordType!{02a27db2-7e8945bbd9162}XXX Project Comments.fields.{254fbd11-79e8-48cb-a5c0-61fa61bcb400}projectId', operator: "=", value: ri!projectId ), a!queryFilter( field: 'recordType!{02a27db2-7e89-494d645bbd9162}XXX Project Comments.fields.{d78a66e6-50ad-433d-b2f3-060522553272}roleId', operator: "=", value: ri!roleId ), ri!filters }, ignoreFiltersWithEmptyValues: true ), pagingInfo: if( a!isNullOrEmpty(ri!pagingInfo), a!pagingInfo(1, 5000), ri!pagingInfo ) )
Mike Schmitt and Bhargavi Prakash
Here I am attaching the inside the expression rule. Can you please check?
That looks fine - you don't have any internal local variables which is what I was worried about (it would be fine but sometimes people don't realize that the cached internal local variables in expression rules like this might not be updating when they think they would).
I know it might not seem to be required, but what if you add a "sync records" node following your Write Record node above? At least, just to see if it makes any difference to the behavior, whether or not you keep it there. Because, the one thing I'm still worried about is that your record action completes and exits before the new entry has quite had time to sync (i'm not sure how fast this is usually supposed to happen, as i haven't had a chance to try this scenario for myself yet).