Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

I need to hide Resolve case and Cancel case button on Homepage grid

(0) ShareShare
ReportReport
Posted on by 5

I need to hide Resolve case and Cancel case button on Homepage grid. I have written the code 

async function HideReport(selectedIds,selectedControl)
{
debugger;
  var id;

id = selectedIds[0].replace(/[\[\]']+/g, '');
        var processtypeId;

await Xrm.WebApi.online.retrieveRecord("incident", id,"?$select=_lgr_processtypeid_value").then(

        function success(result)
            {
             processtypeId = result._lgr_processtypeid_value

});

var isVisible = true;

 await  Xrm.WebApi.online.retrieveRecord("lgr_processtype", processtypeId, "?$select=lgr_hideclosurecommands").then(

  function success(result)
{
     isVisible= !result.lgr_hideclosurecommands; //return the reverse of the Hide Closure Commands flag

});

    return isVisible;

}

But there is one problem Code is working for Homepage grid but when I open the record the same code is giving error, So Now I need suggestion for that code to work only on Homepage grid but not when I open the record. Please suggest me what to do  i.e Code only have to work on Homepage grid but not on form

  • Suggested answer
    Steve Zhao2 Profile Picture
    Steve Zhao2 on at
    RE: I need to hide Resolve case and Cancel case button on Homepage grid

    Hi saikrishna2345,

    Add a custom rule to Resolve case and Cancel case button with your code by using the Ribbon Workbench should solve your issue.

    pastedimage1669858448168v1.png

    Then publish your solution is ok.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans