Out of box, the main forms for the entities in Microsoft Dynamics 365 listed below will have auto-save enabled by default. This means, any changes made to a form will be saved automatically after thirty seconds. In this blog, we show you when and how to disable the auto-save feature.

auto-save
Account Appointment Campaign
Campaign Activity Campaign Response Case
Competitor Contact Contract
Contract Line Email Fax
Invoice Invoice Product Lead
Letter Marketing List Opportunity
Opportunity Product Order Order Product
Phone Call Price List Item Product
Quick Campaign Quote Quote Product
Recurring Appointment Sales Literature Team
Task User

When would you disable auto-save?

Dynamics 365 gives the option to turn off auto-save. While most people may prefer the auto-save turned on, some organizations may have customizations that were designed expecting an explicit save.

If your organization has plug-ins, workflows, or jscripts that run on the OnSave event, they will run each time auto-save occurs. This may potentially cause undesirable results especially if these customizations were not designed to work with auto-save.

If auditing is enabled for an entity, each auto-save is considered a separate update. If your organization has metrics driven on audit history and treat each save as a “touch” of a record, you will see a high frequency of touches thus making an unreliable metric.

If auto-save will cause problems with any extensions or metrics you are using, you can consider disabling it for your organization.

Things to keep in mind

The field that a user is currently editing will not be included in an auto-save.

Since the form reloads after each auto-save, if another user updated the same record while you are editing it, those changes will be retrieved and displayed in the form when auto-save occurs.

With auto-save enabled, the SAVE button in the command bar is not shown after the record is created. You can still see the SAVE button in the lower right corner that will enable if there are any unsaved changes.

When auto-save is enabled, the record will be saved whenever you navigate away from the record or close the window displaying a record. There is no need for the explicit save using the Save & Close button.

How to disable auto-save for the organization

There is no setting to disable auto-save for individual entities or forms.

  1. Go to Settings > Administration.
  2. Choose System Settings.
  3. For the Enable auto-save for all forms option, select No.

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:

auto-save

  • 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.

For more Dynamics 365 tips and tricks, subscribe to our blog!

Happy Dynamics 365’ing!

Avatar for Joe D365

Joe D365

Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.