dynamics-crmmicrosoft-dynamicscrm-ribbon-workbench

In the CRM Ribbon Workbench, how can I hide the Closed as Won button on the Opportunity form based on field in a related entity?


In the Ribbon Workbench, how can I hide the "Closed as Won" button on the Opportunity form based on a text field (accountnumber) in the Account entity? Issue description How can I hide the "Closed as Won" button on the Opportunity form based on a text field (accountnumber) in the Account entity? Each Opportunity can have one associated Account. If the accountnumber field is blank, I want the button to be hidden. I'm assuming I should use a Value Rule, but I don't know exactly how to do this for related entities. If this is not possible to do, what would be the best workaround?

I also have a 2nd related issue. I want to be able to hide the "Collaborate" button that is used for Teams integration, but can't seem to do that in the ribbon workbench either.


Solution

  • You have many solutions... just two of them:

    1. Write a custom javascript that retrieves the value of the related account using web api (here some examples: https://butenko.pro/2018/11/13/showing-ribbon-button-based-on-the-result-of-async-operation/)
    2. Add a text calculated field on the opportunity pointing to the accountnumber of the related account (the syntax for the calculated field is "[lookup name of the account].accountnumber". Then you can use a ValueRule on the new field