locked
Customizing the Cancel case button on CRM 2016 online RRS feed

  • Question

  • 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

    Saturday, August 27, 2016 8:05 PM

Answers

  • Found my way out.

    The problem was with the IE version that I was using which was IE 9.. It works completely fine with IE 10 and above :)

    Sunday, August 28, 2016 6:30 PM