I’m sure others already know about this but if it has been posted about I didn’t find it. Even so, it is probably a worthwhile mention again.
This idea may have holes in it but I wanted to get it published while I can.
At times, based on how we have our Sync properties set (see NOTE below), we may need for certain abilities within the app to be delayed until recent updates are applied.
NOTE: This does assume you have the “Delayed Sync” and “Automatic Updates” properties switched on in your app. Otherwise, you are probably not experiencing the issue this tip is trying to resolve.
Example Use Case
For example, I am currently building functionality that requires interaction between two apps and use buttons to navigate between the two. If I apply changes and then immediately click a button to switch to the other app, there is potential for the updates to be dropped and never applied.
BUT, with this discovery, I can hide that button until the updates have completed.
How to Implement
The trick here is to base the showing of the button (or other visual component) on a timestamp established at the time the row was saved.
In an entry Form, “Initial Value” likely will not work because that value is established when the Form is opened and the Form can be opened for any duration of time. Meaning, the “Initial Value” could be long past and the visual element you are trying to hide will show immediately anyway.
In these cases, I am using an action on Form Save to set my timestamp at save time.
With an appropriate updated timestamp column in the data, the Behavior or Show_If criteria, that controls hide/show of the visual element, can now be set using an expression like:
NOW() > [The Timestamp]+"000:00:01"
You can, of course, combine this with any other criteria needed. And depending on your app performance, you may need to increase the duration value a little.
How it works
When a related data update is made, the expression is evaluated and because the criteria to show the item is based on a future timeframe, the item remains hidden. Once the updates are completed, a Sync is performed and the expression is evaluated again. The criterion time is past and the element is now shown.
This trick can probably be extended to apply to other functions within the app. It can also be used for hiding visual elements after the updates EXCEPT the active view. Unfortunately, when a view is the active view it will remain visible, even if the display criteria hides it, until the user has clicked away from that view.