Microsoft Dynamics CRM 2013/2015 has the ability to save records every 30 seconds automatically when you create new record or update existing record.
Sometimes it might cause performance issues, If you have plug-ins, workflows, or form scripts that execute when a record is saved, they’ll run each time auto-save occurs. This might lead to undesirable behaviors if these extensions weren’t designed to work with auto-save.
This feature can also be disabled at organization level in the System Settings
- Dynamics CRM-> Settings tile
- Click on Settings-> Administration tile
- Click on System Settings icon
- Set No to Enable auto save on all forms under Select the default save option for forms.
- Write following JavaScript code in your entity JavaScript file.
var eventArgs = exeContext.getEventArgs();
if (eventArgs.getSaveMode() == 70) {
eventArgs.preventDefault();
}
}
- In the Form Properties window, in the Event Handlers section, set Event to OnSave.
- Click on Add and choose the above code written JavaScript resource file
- In the Handler Properties window, set Library to the web resource you added in the previous step.
- 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.
- Click OK to close the Handler Properties dialog.
- The Handler Properties dialog should look like this.
Hope this helps.
--
Happy CRM'ing
Gopinath.
No comments:
Post a Comment