Tuesday, January 11, 2011

Prevent CRM from saving a record.

The OnSave event is fired when a user presses the Save or Save and Close button on the form. The event is fired whether the data in the form has been modified or not.

Validating data is a common reason to use the OnSave event. The OnSave event can cancel the save operation before it is sent back to the server. To cancel the save operation, the script should return false as shown in the following code.

event.returnValue = false;

The SDK helps in this situation. Look at the following page for more information. MSDN SDK: OnSave Event

Followers

Subscribe To - MSCRM-Developer

Disclaimer

These postings are provided "AS IS" with no warranties, and confers no rights. The content of this site are my own personal opinions and do not represent my employer's view in anyway. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent, point in time snapshot, you should not consider out of date posts to reflect my current thoughts and opinions.