function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sdavidow9sdavidow9 

Pricebooks in custom VF page on PRM not using sharing rules

Hi, so we have a series of pricebooks set up.  We want our PRM customers to create Orders (using a custom object, not opportunities) that get prices and available products from 1 of these Pricebooks.  We have them select which one to use from a picklist on a custom VF page.

 

We've set up sharing rules to share PB1 with 1 Parnter User record.  In PRM, if we expose Opportunities tab and look at Opportunty Products, only the PB shared is available.  If we go to our custom VF page that asks the User what PB they want to use, all PB are available.

 

We've set the Org Wide Defaults for Pricebooks to "No Access" and we've set the VF page controller to "public with sharing" which should inherit the SFDC sharing settings, but it seems to be overridden.

 

Anyone have any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
sdavidow9sdavidow9

Okay, thanks...I'm assuming there is no fix right now and since it appears that you can query on any sort of sharing table, we'd have to create a custom object that holds the Account-Pricebook relationship and read from that?

 

That was/is our workaround idea, but didn't want to re-invent the wheel if there is a solution.

 

Thanks.

All Answers

mtbclimbermtbclimber

With sharing does not have any effect on pricebook access as you have gathered. This is a known issue, I am afraid.  This is more of an Apex issue than a Visualforce one with the exception that my notion of a workaround using inputField bound to {!opportunity.pricebook2Id} seems to have the opposite issue which I don't believe we were aware of prior to my test. 

 

Please log a case with support on the issue as you have described it and give the rep bug # W-580833 so your case will be tagged to the respective Apex issue.

Message Edited by mtbclimber on 12-14-2009 01:52 PM
sdavidow9sdavidow9

Okay, thanks...I'm assuming there is no fix right now and since it appears that you can query on any sort of sharing table, we'd have to create a custom object that holds the Account-Pricebook relationship and read from that?

 

That was/is our workaround idea, but didn't want to re-invent the wheel if there is a solution.

 

Thanks.

This was selected as the best answer
mtbclimbermtbclimber

Yeah, that assumption is correct and your mechanism to address the sharing limitation seems viable and may offer additional benefits as well given what I understand about your use case.

 

Please do log the case though.

 

Thanks,

Andrew