Disabling Microsoft Dynamics CRM 2013 Auto Save Feature

Disabling Microsoft Dynamics CRM 2013 Auto Save Feature

Microsoft Dynamics CRM 2013 comes with a new auto-save feature which triggers a save action on the forms every 30 seconds. This feature means that if you have a plugin or a workflow, first on saving the form, it will be triggered every time the auto save action is fired. This will obviously cause undesirable actions and potentially unexpected consequences to several processes, especially in the case of an upgrade from the Dynamics CRM 2011 to Dynamics CRM 2013.

To disable the Auto Save feature in the Dynamics CRM 2013, you can stop it at the organization level, which means, NONE of your entity forms will have the auto save across both the customizable (System) and the custom entities and their forms. To do this in the Dynamics CRM 2013, goto Settings –> System Settings –> General Tab> Enable Auto Save on All forms –> No.

Disable Auto Save For Some Entities

If you want to allow Auto Save to work with only some entities, but not on others, you can write a small JavaScript web resource that will disable the auto save on the specific forms.

To do this, you can call the “GetSaveMode()” in the client SDK to detect the auto-save. You can then call the “preventDefault()” to write to the server to prevent the save. Here is the full script:

function preventAutoSave(econtext) {

var eventArgs = econtext.getEventArgs();

if (eventArgs.getSaveMove() == 70) {

eventArgs.preventDefault();

}

}

Steps:

Add the above function “preventAutoSave” as a web resource to your Dynamics CRM JavaScript library. Add this JScript library to the form libraries of the form you want to disable Auto Save on.

You should then register the function on the onSave event on this form you selected.