2

I have multiple (PB) price books, A, B, C, D. I want to give full access to PB C & D to all Sales Reps for all opportunities, and only give access to PB A & D if the Manager selected either of those options for a specific opportunity only. If I remove access to all PB and then open it for C & D with a sharing rule, seems to be fine, and the Sales Reps would only be able to see those two. However once PB A or D would be shared for use on a single opportunity, wouldn't it be available for use on all?

2
  • Validation rule on Opportunity ? Otherwise you could also automate PB assignment if you don't want them to choose
    – brovasi
    Aug 28, 2016 at 22:51
  • Apex managed sharing
    – cropredy
    Aug 28, 2016 at 23:56

1 Answer 1

1

You can use a validation rule to prevent using the price book. It'll still show up in the list, they just won't be able to select it.

Example:

NOT($Permission.Manager) &&
(ISNEW() || PRIORVALUE(Pricebook2Id) <> Pricebook2Id) &&
(Pricebook2.Name = 'A' || Pricebook2.Name = 'D')

This rule says: "If the current user doesn't have Manager permissions, and this is a new opportunity, or the pricebook is being changed, and the price book name is A or D, display an error."

You can also implement this same logic by way of trigger if your code was overly complex. For most cases, I'd suspect a validation rule should suffice.

1
  • Looks great, Let me try it and see if I run across any issues.
    – user8310
    Aug 29, 2016 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.