Hi, 

I have a mobile application that works offline. What I want to do is to trigger the Offline Synchronization when the app gets a connection to the internet. 

I created the option to keep logs of the time of the last synchronization and I only want to set "SyncOnOnline" to true when the last synchronization was more than 30 minutes ago. 

I'm doing that validation on the "OfflineDataSyncConfiguration" as you can see on the image but for some reason, it's not working. Any ideas on how to do this?

Hi, 

When you debugging this action, what the action "CheckLastSyncLog" return? Do you enter in this action?

Regards

Hi Paulo,

it has an aggregate where I see if the last sync was done more than 30 minutes ago and has a boolean output that I use on "SyncOnOnline". When I use the debugger on the action I can enter de action and the output is correct, but while I'm on the "CheckLastSyncLog" action the rest of the "OfflineDataSyncConfiguration" action runs and the screen is fetched. Looks like it runs asynchronously... 

Solution

Hi,

Why you don't use a client variable or local aggregate instead of a server action with an aggregate to check when was the last synchronization? And then, you do all the validation from the client side.

(I don't know if this scenario can be used in you case)


Regards

Solution

Hi,

It's working! Many thanks! I changed that logic to local storage and fixed the problem. 

Hi André,

Nice, you are welcome!