WHEN YOU WANT TO ABORT AN SAVE OPERATION IN MS CRM , WE CAN USE THIS JAVASCRIPT TO STOP SAVE OPERATION IN MS CRM

   context.getEventArgs().preventDefault();

1. FIRST ADD A WEB-RESOURCE PASSING PARAMETER .

function checkbox(context) {

    var innerhtmls = Xrm.Page.ui.tabs.get("{cab6696b-b74a-47a4-b278-fc07fe780565}" ).sections.get( "Sec_IdProof").$1l_0.innerHTML;
    var checkedis = innerhtmls.match( /defaultvalue="1"/g );

    if (checkedis == null) {
        alert( "Please Select An Address Proof && An ID Prooof" );
        
        context.getEventArgs().preventDefault();
    }
}

2. CHECK THE CHECKBOX ( PASS EXECUTION CONTEXT  AS FIRST PARAMETER )





References



SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012