Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Customizing the Cancel case button on CRM 2016 online

$
0
0

Hi,

I am currently working on a requirement related to cases - when the user clicks on the cancel case button on a case, I need to make some fields mandatory on the form and prompt the user to fill them.And once the user populates these mandatory fields and again click on cancel case button, the default case confirmation dialogs should appear. This is not happening with the script i use - mentioned below - i get the first confirmation dialog but when I click on 'Confirm', the window just freezes.  

Please let me know what could have gone wrong.

Code is as below -  i call the default function to cancel a case - Mscrm.CommandBarActions.cancel()

CancelCase = function () {

    if (Xrm.Page.getAttribute(fieldname).getValue() == null) {
        alert('You must provide a value for the field.');
         Xrm.Page.getControl(fieldname).setVisible(true);
         Xrm.Page.getAttribute('fieldname).setRequiredLevel('required');
  }
else {
debugger;
Mscrm.CommandBarActions.cancel();

}

Thanks for all your help in advance.

Regards,

Anwesha


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>