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
weraysdtjifrytgweraysdtjifrytg 

Lookup to Pricebook

Hiii

 

Can anyone tell me if it is possible to create a lookup to a Pricebook list?

 

I need Products AND their related price to be filled in a custom object.

 

Thanks

Always ThinkinAlways Thinkin

Because a Product can have many different prices, you would have to specify from which Pricebook you want the Product's price returned, even if you have only one Pricebook.

 

Standard formula fields don't give you a way to specify a specific pricebook, so you would need to resort to Apex to handle that.

weraysdtjifrytgweraysdtjifrytg

Hi Luke,

 

Thank you for your reply.

 

Unfortunately I only have Professional Edition, and I can't build triggers on that. All I can do is Visualforce pages and custom buttons.

 

Do you know if this would be something possible to do with let's say a custom button with on-click Java (something like create, query). I need to know if I should at all spend my time trying to figure that out...

 

Thanks.

Simona

weraysdtjifrytgweraysdtjifrytg
sorted
WhitlamWhitlam
How did you resolve your lookup to a specific pricebook please? This is exactly what we are trying to do on a custom Inventory object. Thank you, Jen
emuelasemuelas

Hi,

 

We have the same issue....

Please let us know how to resolve this

Always ThinkinAlways Thinkin

Hi,

For whitlam and emuelas, if you are able to do an Apex solution, this Quoting Application Example from the earlier versions of the Apex guide walks you through doing lookups to pricebooks. It does it from an Opportunity Line Item which has the built in advantage that it already has one Pricebook associated with each record (the PriceBookId field on Opportunity Line Items).  If you were attempting to reference the Pricebook from a custom object, each record in your custom object would need to have a way to identify the particular pricebook(s) it will reference, perhaps by hardcoding a list of the known pricebooks (or, if you want to get fancy, by using Visualforce to query for pricebook IDs and building a list every time the edit page is accessed).

emuelasemuelas

Thank you Luke....

 

Will have a go at this