Home > Web Front-end > HTML Tutorial > Dynamic CRM 2013 Study Notes (Twenty-Four) Logic verification before saving the page_html/css_WEB-ITnose

Dynamic CRM 2013 Study Notes (Twenty-Four) Logic verification before saving the page_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:51:16
Original
1397 people have browsed it

We sometimes need to verify some logic on the page, for example, the start time cannot be later than the end time, and if it is not in time, it will not be saved. We can handle related field events, but this will be more troublesome if there are many fields to be judged. At this time, we can use the OnSave event of the Form. The specific method is introduced below:

1. The OnSave event of the Form

2. JS method

function formSave(context) {
Copy after login
    if (!dateCheck("new_valid_on", "new_valid_to")) {
Copy after login
        alert("Valid To is earlier than Valid On !")
Copy after login
        context.getEventArgs().preventDefault();
Copy after login
Copy after login
    if (!dateCheck("new_valid_from", "new_valid_to")) {
Copy after login
        alert("Valid To is earlier than Valid From !")
Copy after login
        context.getEventArgs().preventDefault();
Copy after login
Copy after login

Use this sentence to block when the conditions are not met Save:

context.getEventArgs().preventDefault();

Isn’t it very simple, no need to do it for every Write a method for each related field.

Dynamic CRM 2013 study notes series summary -- continuously updated

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template