Refreshing Form After Save

Hi Ron,

Thank you for sharing your application.

As mentioned, the event On Cancel won’t work in this scenario because this event was not designed to modify form field values.

The On Cancel event would work if the field is bound to the database and the data is already saved in that field when accessing the record; So, the latest values stored in the DB will be restored to the field when cancelling teh changes.

What you could do is:

When you detect that the information is invalid, instead of using five.createError, you could use five.confirm and ask the user if he wants to retrieve the data, then call your function that puts the data back. However, in your current code, it won’t work because once the format is wrong, you clean the field ‘Settings Value (Bound)’, and this field sends the data to the field ‘SettingValue JSON’. (If I understood your logic)

This link has an example on how to use five.confirm in case it helps you.

Delete and Edit not Working Properly - How do I? - Five | Community Forum

Regards,
Elton S