Ms crm form cancel onsave event

Source: Internet
Author: User

 

Address: http://www.cnblogs.com/jfzhu/archive/2012/09/21/2697571.html

Reprinted please indicate the source

 

In JavaScript, window. event. returnvalue can be used to cancel an event.

For example, click a link <.... />, we can add an onclick event processing for this link, and add window to the processing. event. returnvalue = false, so that the link will not jump us to another URL.

In CRM 4, we also have similar solutions. In onsave processing of a form, event. returnvalue = false can be used to cancel saving.

In CRM 2011, canceling form onsave is more complicated.

First, select "Pass execution context as first parameter" when adding the onsave processing function"

Then, in your defined function, you must first have a executionobj parameter about context, and then you can use executionobj. geteventargs (). preventdefault ()

Function onsavehandler (executionobj) {// place all your data validation here // In case data is not valid call the below method // The geteventargs () method returns an object with methods to manage the Save event. // The preventdefault () method cancels the save operation executionobj. geteventargs (). preventdefault ();}

For details, see the "Save event arguments reference" section of CRM 2011 SDK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.