cancel
Showing results for 
Search instead for 
Did you mean: 

How can sync without go to home?

Former Member
0 Kudos

Hi, i want sync but another form that go to the MI home and press the icon... I want to know if someone of these two ways is possible:

- A button in a page of my project.

- Automatic every x time.

Thanks,

Message was edited by:

Victor Capi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Victor,

is your password handling set to local or do you have to enter a password each time you sync? What is in the log? Switch on your log if it is empty. You should see an error message.

Regards,

Oliver

Former Member
0 Kudos

I add this in config:

MobileEngine.Security.SynchronizationPasswordHandlingOption=local

and work fine.

Answers (2)

Answers (2)

Former Member
0 Kudos

Add this to the config file:

MobileEngine.Security.SynchronizationPasswordHandlingOption=local

This will help

Former Member
0 Kudos

Hi Victor,

I have send you the code todaywith MSN. The code to sync is:

SyncManager syncManager = SyncManager.getInstance();

syncManager.synchronizeWithBackend();

But as I said, the problem on that is, you have to handle the error handling as well. If an error occures inside MI you have to check the SyncLog.

SyncLog syncLog = SyncLog.getInstance();

In there you have GetHandlers for the different types of errors.

This can be done whenever you have done a save for example. BUT, be aware of a few things:

Whenever you do something automatically, this stops the user from continue with his work. Every sync changes the persistence. First of all one thing:

lets say you read an object and display the entry. While you do that this automatic sync starts in the back. The user changes something in the UI and tries to save it, but the item was already deleted with the automatic sync. So the safe fails.... Or you save an item and the system tries to sync automatically. In some special cases this will make sence, but not always. Well, this is an area we can discuss hours and hours. If you have the need to have the most actual data, then perhaps it is better to think about an online app.

And because of all the reasons that could be problematic, it makes no sence to have automatic sync.

Anyway - if you need something like an own button or automatic sync, test it carefully and be aware of some issues that will come around! Anyway I hope the above code helps you.

Regards,

Oliver

Regards,

Oliver

Former Member
0 Kudos

I write this:

SyncManager syncManager = SyncManager.getInstance();

syncManager.synchronizeWithBackend();

But no sync