Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
Hi all,

I've got a related list on my Opportunity page layout.  It has a custom button on it with OnClick javascript.  I want the button to be visible only if the Opportunity.StageName = 'Closed/Won'.  I've done this using a VisualForce page on the layout that hides the button, but this seems incredibly kludgy.  Does anybody have a better suggestion?

Thanks, Jim
5 answers
  1. Jan 28, 2015, 11:06 AM
    Hi Jim,

    you can add some js to the button, so that the user receives an information, that this button is only working on Stage Closed/Won.

    It could be something like:

    if (stage != 'Closed/Won') {alert('This is not working in this stage')} else {*here you can add your code*})

    Regards

    Robert

    (mindforce: http://www.mind-force.de)
Loading
0/9000