How to disable auto-save for a form
If you wish to disable auto-save for specific entity forms, you can do this by adding code to the OnSave event in the entity form.
1. Create a JavaScript web resource and add it to the form
- Enter the following information in the web resource form:
- Name: preventAutoSave
- Display Name: Prevent Auto Save
- Type: Script (JScript)
- Next to the Type field, choose Text Editor.
- In the Source field, paste the following code (see code box below to copy):
- Add the web resource to the Form
2. Configure the OnSave event
- In the Form Properties window, in the Event Handlers section, set Event to OnSave.
- Enter the following in the Handler Properties:
- Type ‘preventAutoSave’ in the Function field. This is case sensitive. Do not include quotation marks.
- Make sure that Enabled is checked.
- Check Pass execution context as first parameter.
- If there are any other event handlers for the OnSave event, use the green arrows to move this one to the top
Auto-save will now be disabled for the form, but data can still be saved by clicking the Auto save button in the lower-right corner. If users attempt to navigate away from a form or close a form where data has been changed, they will get a prompt to save their changes before they can navigate away or close the form.
Comments
Post a Comment