Hi,
we are trying to refresh local variable value on var change but it is not working. PFB Code
a!localVariables( local!refreshOnVarChange: false, local!allMessages: a!refreshVariable( value: rule!DS_QRY_getMessageThread( returnDatasubset: false, filters: a!queryFilter( field: "clientInboxId", operator: "in", value: {15,16} ) ), refreshOnVarChange: local!refreshOnVarChange /*refreshAlways: true, even in this case data is also not get refresh*/ ), local!textBox, a!sectionLayout( contents: { a!textField( value: local!textBox, saveInto: { local!textBox, a!save(local!refreshOnVarChange, not(local!refreshOnVarChange)) } ), a!textField( value: length(wherecontains(true,index(local!allMessages, "isRead", ""))), readOnly: true ) } ))
Discussion posts and replies are publicly visible
Adding my experience here - as this is something I've been tempted to start a thread on as well.
What I've seen is that if you have a refresh variable that calls a rule which contains a!queryEntity(), it will not refresh automatically. Simply moving the query out of the rule and into the main refresh variable, resolves the issue. However, then you have duplicated code if other areas of the application use the rule to query data also.
I haven't exhausted the different scenarios here yet, but I was noticing this last while creating a small message board type app. The main interface makes a post with a!writeToDataStoreEntity(), I trigger the local variable to refresh by incrementing a reload counter used in refreshOnVarChange, and in no situation can I get it to refresh without pulling the query out of the rule and pasting it in the main refresh variable. Then, it works flawlessly.
Would love to hear some other experiences on that as well..
Sounds like you might have some other stuff down inside your expression rule gumming up the automatic refresh.