web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

"Resolve Case" Button Doesn't Work After Upgrade to CRM 2016

(0) ShareShare
ReportReport
Posted on by

Hello everybody,

We have an on-premis deployment of CRM 2016 (including SP1). Since the upgrade, the "Resolve Case" button on the Case form no longer functions. However, if we turn on "Legacy Form Rendering", it does. This is not a viable option, since "Legacy Form Rendering" is a temporary measure, and causes other issues. We have gone through the custom JavaScript on the form and have even gone so far as removing all of the custom code from the form and deactivating related plugins. Same result. I have seen similar posts about the "+" button on sub-grid, with no real viable solutions. Any insight?

*This post is locked for comments

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I have exactly the same environment - On-Premise, CRM 2016 SP1 but I can't reproduce this issue. Have you customized Resolve button?

  • Community Member Profile Picture
    on at

    Hi Andrii,

    Thank you for the response. Yes, the Resolve button triggers a custom JavaScript function. Right now, the function simply validates the "Status Reason" of the record before resolving. I'm trying to see if I can restore this button to it's default behavior. Then, I can rebuild the validation after.

  • Mahendar Pal Profile Picture
    45,095 on at

    Also check if there is any unsupported code written in that function which may cause this issue as well.

    Thanks

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello John,

    It is possible to restore OOB behavior using Ribbon Workbench. Just choose Uncustomize command in it.

    I recalled that namespaces and methods were changed. I had similar issues with customized Win/Lost opportunity button. Please post code of custom function here.

  • Community Member Profile Picture
    on at

    Thanks again,

    I am using Ribbon Workbench now. I will uncustomize it and see what happens. If I have any further issues with adding the code (or a new variant of the code) back in. I will keep you posted. Thank you for your quick responses.

  • Community Member Profile Picture
    on at

    Hi Andrii,

    Still no luck. Here is this code. Interestingly, the validation part works, and the appropriate message displays. However, if the check condition is met, the form will not resolve.

    function ResolveCustom() {

       //debugger;

       //Xrm.Page.data.entity.save();

       var casetitle = Xrm.Page.getAttribute("bkm_casetitle");

       var customer = Xrm.Page.getAttribute("customerid");

       if (casetitle == null || customer == null

           || (casetitle != null && casetitle.getValue() == null)

           || (customer != null && customer.getValue() == null)) {

           if (customer == null || (customer != null && customer.getValue() == null)) {

               //alert("A customer is required.");

               Xrm.Page.ui.controls.get("customerid").setFocus();

               return;

           }

           if (casetitle == null || (casetitle != null && casetitle.getValue() == null)) {

               //alert("A case title is required.");

               Xrm.Page.ui.controls.get("bkm_casetitle").setFocus();

               return;

           }

       }

       var isFound = testCase("Ready for Invoicing/Close", "statuscode");

       if (!isFound) {

           // Use the code line below only if validation is failed then abort function save event

           alert("Case status must be 'Ready for Invoicing' before resolving the case.");

           return;

       } else {

       /*  else {

             //debugger;

             var invoicenumber = Xrm.Page.getAttribute("bkm_invoicenumber");

             //alert("invoicenumber: " + (invoicenumber != null));

             if (invoicenumber != null) {

                 var invoiceno = invoicenumber.getValue();

                 //alert(invoiceno + invoiceno.length + (invoiceno != null && invoiceno.length > 0));

                 if (invoiceno != null && invoiceno.length > 0) {

                     // Call Out-Of-Box Resolve

                     resolve();

                 }

                 else {

                     // Use the code line below only if validation is failed then abort function save event

                     //alert("Invoice Number is required when resolving before resolving the case.");

                     Xrm.Page.ui.controls.get("bkm_invoicenumber").setFocus();

                     return;

                 }

             }

             else {

                 // Use the code line below only if validation is failed then abort function save event

                 //alert("Invoice Number is required when resolving before resolving the case.");

                 Xrm.Page.ui.controls.get("bkm_invoicenumber").setFocus();

                 return;

             }

         }*/

           resolve();

       }

    }

    function testCase(textValue, optionSetName) {

       var isFound = false;

       var status = Xrm.Page.getAttribute("statuscode");

       var statusCode;

       if (status != null) {

           statusCode = status.getValue();

       }

       if (statusCode != null) {

           var optionSetTypeOpts = Xrm.Page.getAttribute("statuscode").getOptions();

           for (var o in optionSetTypeOpts) {

               if (optionSetTypeOpts[o].text == textValue) {

                   if (optionSetTypeOpts[o].value == statusCode) {

                       isFound = true;

                       break;

                   }

               }

           }

       }

       return isFound;

    }

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Try to replace lines where you have

    resolve();

    with line

    Mscrm.CommandBarActions.resolve();

  • Community Member Profile Picture
    on at

    That was it! I'm almost embarrassed that I didn't catch that. I guess I'm too close to it :). Thank you so much, Andrii!

  • sdsdwewe Profile Picture
    5 on at

    Helped me very much. Thanks!

  • Ashutosh Pandey Profile Picture
    40 on at

    Just updated into potassium version but resolve functionality is not working. Just calling one custom function for hiding button based on column value.Here is my code pls suggest:

    function HideResolveButton() {
    var activeStage = Xrm.Page.data.process.getActiveStage();
    if (activeStage.getName() == "Resolved") {
    var flag = false;
    Xrm.Page.getAttribute("mcio_resolutioncomments").setRequiredLevel("none");
    var value = Xrm.Page.getAttribute("statuscode").getValue();
    if (value == 277140003) {
    var currentUserRoles = Xrm.Page.context.getUserRoles();
    if (currentUserRoles != null) {

    for (var i = 0; i < currentUserRoles.length; i++) {
    var userRoleId = currentUserRoles[i];
    var role = GetRoleName(userRoleId);

    if (role == "System Administrator" || role == "DCDPM") {
    flag = true;
    Xrm.Page.getAttribute("mcio_resolutioncomments").setRequiredLevel("required");
    return flag;
    } else {
    flag = false;
    }

    }
    }

    }
    return flag;
    }
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans