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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Unable to hide the Ribbon Button

(1) ShareShare
ReportReport
Posted on by 8
Hi Folks,
I'm trying to hide the ribbon button in an entity which will lies on the condition and depends on another entity.
 
Here is the scenario. There is an entity 'Account' it has ribbon button called 'Degrade'. In Account entity there is an Contact Lookup field which holds the contact records. Now in contact form there should be data in tab1, if there is no data/record present under the tab1 of contact record which is selected through lookup in Account then Degrate button should be hidden. 
 
I want to done this process with RibbonWOrkbench.
 
 
Thanks in advance.
I have the same question (0)
  • Inogic Profile Picture
    703 on at
    Hi,
    Here’s what you can do:
    Step 1: Create a JS web resource with code
    For example, I have created a function called “hideDegardeButton” which will check if the account entity contains contact lookup or not.
    If contact lookup is enabled, it will check the "fax" fields in the contact entity by calling the “checkFaxData” function, if not then it will return false.
    Note: “hideDegardeButton” function contains account form Control as parameter & “checkFaxData” function contains contact lookup id as parameter.

    If “fax” field in contact entity contains data then it will return true, if not then it will return false.
    Note: Based on the “return” values, I’m hiding the “Degrade” button in Account form.


    Upload the JS web resource in a solution and Publish the Web resource.

    Step 2: Prepare Ribbon Workbench 
    In the ribbon work bench click the account entity and add the button that will enable the rule. Once selected, click on the Enable rule section and add a new rule or type of Custom Rule. Select the JS web resource and specify the function name. Add CRM parameter as Primary Control.
    Also ensure the following two steps before publishing the ribbon workbench
    1. The Command must be attached to the button.

     
    1. And the Enable Rule must be attached to Command itself.




    Step 3: Publish and Test.

    Know that the button is visible when Fax field contains values,





    And that the button will not be visible when Fax field contains no values,





    Hope this was helpful!
     
    Thank you!

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans