You need to sign in to do that
Don't have an account?
bakul.patel
No access to products but use pricebook
Hi,
I have a situation wherein I want to hide products from users but still let them use pricebooks (through apex).
I have a trigger to assign default pricebook to opportunity. But I get an insufficient priviledges error, which is I think because I have take away access to prdoucts (which takes away access to pricebooks).
Does anybody have suggestion to take away access on products but still let users use pricebooks?
Bakul
I have a situation wherein I want to hide products from users but still let them use pricebooks (through apex).
I have a trigger to assign default pricebook to opportunity. But I get an insufficient priviledges error, which is I think because I have take away access to prdoucts (which takes away access to pricebooks).
Does anybody have suggestion to take away access on products but still let users use pricebooks?
Bakul
Not 100% sure the sharing thing will work, but it's worth a shot if just removing the Product tab isn't enough.
[1] https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm
I will try out your suggestion about calling a class from trigger. Though I was under impression that triggers always run in admin context.