0

How to disable add product button in opportunity when i select stage as prospect

I want to disable add product button in related list of opportunity when i select stage as prospect. and i want to enable that button when my stage is ordered. please help me

1
  • you can override the add product button and show the alert message. based on your condition
    – Ratan Paul
    Nov 17, 2015 at 6:49

1 Answer 1

1
  1. Create a new custom button from Setup-> Opportunity product-> Button and Links
  2. Add following code in that

    if({!ISPICKVAL(Opportunity.StageName, 'Prospecting')})
    {
        alert('You can not add product');
    }
    else
    {
      window.location.href='/p/opp/SelectSearch?addTo={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}'
    }
    

enter image description here

3.Add button to Opporutnity page layout in related list of product.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .