You need to sign in to do that
Don't have an account?
Robbi Converse
Select a particular price book on a Visualforce page
I have a Visualforce page that requires users to select a price book when one has not yet been selected for the opportunity. I want to specify which price book is being used. How do I alter the following to specify a pricelist named "Medical"?
<apex:page standardController="Opportunity" extensions="opportunityProductEntryExtension" action="{!priceBookCheck}" >
<apex:page standardController="Opportunity" extensions="opportunityProductEntryExtension" action="{!priceBookCheck}" >
All Answers
Or, do you want to enforce a (single) PriceBook on the record?
If it is the second option, I guess you can do that in your opportunityProductEntryExtension class itself.
As you can see, I didn't include the PriceBook field in the VF page, because I wanted to enforce it with a specific value in the APEX class.
In the APEX class, I have fetched my "Northwest Diesel Generator Sales" PriceBook and used it as the only PriceBook possible.
It would be "Medical" in your case.
Hope this helps.
And, ensure that the PriceBook field is not available for the user to change in the VF page.