Auto save while entering the datas

0
Question:How can I set up auto-save functionality in Mendix so that data is saved as users enter it, rather than only when they click the Save button? This way, if the internet connection drops or an error occurs, the data entered up to that point is already saved.Context:My current workflow is:Dashboard with a CreateRecord buttonButton triggers a microflow that creates objects and displays a form pageUser fills in the formSave button triggers a microflow where I commit the changesWhat I Need:I'm looking for guidance on what changes I should make to enable parallel saving while data is being entered, so that user input is persisted automatically rather than only on final submission.
asked
2 answers
0

In addition to a save button, you can put several events on input fields. You can trigger microflows on change, on enter, on leave, etc. You'll have to think about when you want to save the data - do you even want to save when they're in the middle of a word? Or only when they leave the field?


In the microflow you put in the event, simply trigger any validation you need and then commit the value. Do note that this will lead to more database transactions, so if you have an app with high numbers of users this might have an impact on performance.



answered
0

Hi Jagan,

You can use the events - Mendix Marketplace - Events, use it in the edit page and configure it to save changes every x seconds.



But with the above approach, data is saved every x seconds even if there is no changes. To optimize it even more, you can call a nanoflow instead of save changes and in nanoflow check if the object is modified using javascript. If modified then commit else don't commit.


Reference to JS - Mendix 11 Dojo Client Documentation mendix/lib/MxObject


Hope my answer helps. Reach me out for any queries.

answered