Display accounts in an app
I’ve created an app that uses the Accounts entity in my CDS as a data source and Accounts are being displayed.
My app has a form to add new accounts to my database.
This all is great when I’m the only user, however when there are multiple users you might run into some refresh issues.As one app instance adds a new account the other users will not see this new item
Auto-refresh data with timer
To solve this issue I’m adding a timer to my screen displaying the gallery of accounts.
On the timer you will need to set the Auto Start and Repeat and set the OnTimerStart as shown above. this will load the data in a MyData variable. Now update the Gallery to use MyData instead of the Accounts data source.Now as one user adds a new record.
After a while you will find that the gallery in both instances synchronises. To control the refresh rate of your app you could consider some of your timer settings.
Frequently asked questions
Why might one user not immediately see another user’s new record?
The example’s gallery data is not automatically refreshed as another app instance adds an account.
How does the article refresh the gallery?
It uses a repeating timer to reload data into a variable and points the gallery at that variable.
How is the refresh interval controlled?
The author suggests adjusting the timer settings to change the refresh rate.

