Disabling Auto Save feature in Dynamics CRM 2013

Disabling Auto Save feature in Dynamics CRM 2013

In this article am going to explain how to disable Auto Save feature in Dynamics CRM 2013.
 
What is Auto Save?
  1. Microsoft Dynamics CRM 2013 comes with a new feature "Auto Save" which helps to save the record automatically within every 30 second (approx.).
  2. This feature reduces the extra click and data loss in case of any connectivity issue. It means if you are editing a form "Auto Save" is triggered within every short interval.
  3. Auto Save will not trigger if there are any validation failed e.g Missing required field.
  4. Auto Save capability not applicable for Quick create or Mobile Form. 
  5. While creating a New record "Save" button need to be clicked for the first time manually then "Auto Save" works.

By default Dynamics CRM enable this feature.

Auto Save Impact
 
Though it saves record in every short interval all the events associated to the Form will trigger automatically. This means all the server side Plugins, Work flows and audit logs will be called automatically which might degrade performance of the system.
 
How to Enable or Disable Auto Save in Organization level 
 
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 
 
 
 
How to Enable or Disable Auto Save in Entity or Form level

If you want to allow Auto Save to work with only some entities, but not on others, you can write a small JavaScript 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. Then register the function on the onSave event on this form you selected.

 
Summary 
I hope this Article will help you to understand the "Auto Save" feature of Dynamics CRM 2013 and how to disable this to avoid execution of server side plugins and workflows.
Please share your valuable comment on this.
comments powered by Disqus