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.
  • Inogic Profile Picture
    438 on at
    Unable to hide the Ribbon Button
    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

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... 293,041 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,856 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans