Skip to main content
Community site session details

Community site session details

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

I want to hide reactivate button when case status = resolved. The code is under image can anyone please say it is correct or not and it is not working

(0) ShareShare
ReportReport
Posted on by 42

16655761928228125655296080144144.jpg

function OnChangeSetVisibilty(primaryControl)
{
var isVisible = false;
var formContext = primaryControl.formContext();
formContext.attributes.get("lgr_processtype").getValue() != null


if(formContext.attributes.get("lgr_processtype").getValue() != null && formContext.attributes.get("lgr_processtype").getValue()[0].name =="change in Nominated Retirement age")
{
isVisble = true;

}
retrun isVisible;

}

  • saikrishna963 Profile Picture
    42 on at
    RE: I want to hide reactivate button when case status = resolved

    Hello Bipin as I am beginner to write a code from scratch can you please give me a demo code so that I can replace with my lookup field names and all these your help is appreciated

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: I want to hide reactivate button when case status = resolved

    Hi,

    I don't think so because of the lookup field. If field is optionset then we can easily do without any code.

    Javascript code should be simple.

  • saikrishna963 Profile Picture
    42 on at
    RE: I want to hide reactivate button when case status = resolved

    Without writing js code, it is not possible to hide that resolve case button??

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: I want to hide reactivate button when case status = resolved

    Hi,

    You will need to write javascript code to do that.

    Get lookup field value and then check the name .based on name return true or false

    Enable Rule - Custom javascript rule

  • saikrishna963 Profile Picture
    42 on at
    RE: I want to hide reactivate button when case status = resolved

    i want to hide resolve case button when process type = change in NRA16655787507024982649411305606165.jpg

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: I want to hide reactivate button when case status = resolved

    Hi,

    Yes it worked for me.

    Reactivate button is not visible on closed cases. But visible on Open Case.

    Can you update as I suggested then publish your changes. Now open closed Case to see if button is still visible.

    Please send me screenshot after you done updating

  • saikrishna963 Profile Picture
    42 on at
    RE: I want to hide reactivate button when case status = resolved

    Is it working for you have you checked that

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: I want to hide reactivate button when case status = resolved

    Hi,

    We don't need new display rule for your requirement.

    You can simply change Inver result of FormstateRule to true.

    Make sure to publish your changes.

    Please see below imageIMG20221012170936.jpg

  • saikrishna963 Profile Picture
    42 on at
    RE: I want to hide reactivate button when case status = resolved

    16655744567028193063941674041911.jpgIn the display rules my display rule is not there what should do I now

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: I want to hide reactivate button when case status = resolved

    Hi,

    Please debug by adding RibbonDebug=true in url .

    Check the link I shared earlier.

    Please share screenshot of the command with display rule

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans