locked
Is it possible to disable the ribbon button based on the stage of Opportunity.? RRS feed

  • Question

  • User cant close opportunities unless they are at the "Close" stage (on the Business Process Flow) So can we disable the "Close as Won" but still allow “Close as Lost” unless they are not on that part of the flow. If they select Close stage then and then Close as won ribbon button should be enabled?

    Is there any way to do so?script,plugin or anything else?
    Wednesday, January 8, 2014 11:22 AM

Answers

  • Hi,

    A more safe solution is to use Ribbon Workbench solution. The solution gives you a visual environment even to disable some ribbon buttons based on other fields.

    Thursday, January 9, 2014 7:49 AM
    Moderator

All replies

  • Hi,

    I think it's possible, just follow those steps to modify RibbonDiff xml:

    1. Hide the OOTB buttons with CustomHideAction.

    2. Duplicate OOTB buttons and change their ID.

    3. Use DisableRule along with ValueRule (you need to put Stage field in the Opportunity Forms to use ValueRule - it can be hidden).

    Note: You can only use ValueRule in Form context. In HomeGrid view context, you need to use CustomRule since ValueRule does not work in this case.

    Hope it helps.

    Wednesday, January 8, 2014 11:59 AM
  • How can i know the value of Stage
    Wednesday, January 8, 2014 1:31 PM
  • ??? Opportunity Stage is field, you can go check that field to see what option set linked to it.
    Thursday, January 9, 2014 4:19 AM
  • Hi,

    A more safe solution is to use Ribbon Workbench solution. The solution gives you a visual environment even to disable some ribbon buttons based on other fields.

    Thursday, January 9, 2014 7:49 AM
    Moderator
  • HI 

    If i got your que . based on the stage of Business Process Flow you want to hide the Btn . Every Business Process flow enabled entity having Stageid Field which contain the guid of Current Stage of BUsiness process flow . You have to modify the Enable Rule for "Close As Won" btn .Write custom Enable rule , In script  Retrive  stageID and check your condition to return true or false to display button .. .


    Zafar Khan

    Thursday, January 9, 2014 2:06 PM