What happens if object is updated but not sync’d?
Two questions:
1/ what happens if you update an object, perhaps setting .setEditingMode() first, but you never end up calling .syncItem()? Does the original obj remain untouched, or does the object disappear into a black hole?
2 what happens if you update an object, then call .syncItem() and then update the object again, using the original reference to obj, and then call .syncItem() again? Is this OK, or should you retrieve a new reference to the updated object first? Ie does the reference to obj change after any/all .syncItem()s?
Many thanks.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Stuart Beesley ... on 25 Jul, 2021 12:29 PM
From Sean…:
those objects would just sit around in editing mode until the next time that they are synced or updated. If you restart MD while they are in editing mode then the changes are lost. So... good to remember to syncItem()!
That should be fine. The same object is kept around... if it is updated, then the same instance of the object will be updated.
FYI .itemWasUpdated() is called after the underlying SyncRecord is updated. It will reload the object fields from SyncRecord/info. But the object instance should be the same.
So, questions answered. Thanks.
Stuart Beesley (Mr Toolbox) closed this discussion on 25 Jul, 2021 12:29 PM.