Salesforce: Restrict Opportunity to Specific Pricebook

Question: Is there anyways that you can restrict specific Account to only use a specific Pricebook? For example, Account – Acme Pty Ltd needs to be tied to only Acme Pricebook. Therefore, all the Opportunity created by Acme Pty Ltd can only use Acme Pricebook.


Option #1: Validation rule

  1. Create a lookup from Account to Price Book
  2. Create a validate rule on the Opportunity – check the PriceBook ID on Opportunity against Price Book on the account. Throw an error if does not match.
    For example: Pricebook2Id <> Account.Price_Book__c.


Option #2: Trigger

  1. Create a lookup from Account to Price Book
  2. Create a trigger on Opportunity to populate the Price Book ID from the account
  3. Optional: You can also validate the trigger if the sales rep tries to change the price book.


Additionally, you can also implement a checkbox in Opportunity to apply flexibility to above solutions. This is to cater for a scenario where one of the Acme Pty Ltd Opportunity needs to use Standard Pricebook. So, when this checkbox is checked for this particular Opportunity, the user can then choose any other pricebooks.


Sample Validation rule will look like: NOT(ISBLANK(Account.Price_Book__c)) && NOT(ISBLANK(Pricebook2Id))  && Ignore_Account_Pricebook__Checkbox__c == FALSE && Pricebook2Id <> Account.Price_Book__c