Synchronization error in Native mobile app after uploading images.
0
Hi All, I have a scenario in the Native mobile app where the user has to go through 4 different screens and answer questions before they hit the final save button to create a record in the system. In between on page 2, there is also an option to add images. The challenge that I see here is that Mendix auto-commits the image object when added even without any explicit commit on this entity. Since the image entity is associated with other entities that are not yet committed to the database, it returns the below error Synchronization message. Synchronization has failed due to a modeling error. Synchronized objects reference either uncommitted objects or unsynchronized objects that are not selected for the current synchronization object of type Auto.Image with guid GUID:id_csm_128 with association(s) Auto.Image_Vehicle Is there a way to handle auto-commit on image entity to not persist it so that I do not have to run any cleanup even if the user closes the app? If not, how can I better handle this Synchronization Problem? FYI.. we have timer event running in app in background which triggers a nanoflow every 30 seconds to synchronize any committed objects. Thanks in advance.
asked
Pranay
1 answers
1
Use non-persistent helper objects to keep track of the associations, and only set associations to your pesistent entities at the very end of the steps. Cleanup is unavoidable I think when a user does not finish all the steps, although you could use a boolean value and an after-commit event to check if the image was auto-commited or explicitly commited.