Have implemented a page to manage Quote Line Items. This page is modeled after the Action Framework (AF) Deep Dive where: 1) Use a prototype QuoteLineItem to select default values e.g. Quantity, Shipping Type,etc. 2) Instead of showing a table of PricebookEntries, I have a custom junction object of Product / Plant Association records. 3) The user filters the table by Plant and then selects to Add the product as a Quote Line Item 4) One of my actions is to Create new row in Model (QuoteLineItems) and set default values. One of the required fields is PricebookEntryId. Since my table of products is using a custom object, how do I look up the corresponding PricebookEntry record? Note that I already have the PricebookId from the Opportunity and Quote. Any guidance would be very much appreciated. Thanks, Irvin
If there is no relationship between your product / plant association records and pricebook entry (which is product / pricebook association) then you may be in a datamodel bother and may need to explore more fundamental changes. But if you can traverse your custom object up to the pricebook entry parent record you can include that in the prepopulation action.
Yeah, that’s what I thought. This year Salesforce finally allowed custom fields to be created on the PricebookEntry standard object. So I think that I can add a Plant custom field (lookup to a Plant__c) and then create a Filter on the PricebookEntry table where PricebookEntry.Plant__c = Plant.Id. Thoughts?
Not sure I completely follow, but you are going to have to do somthing like that… I was actually thinking that you would need to change your custom junction object so it was between pricebookEntry and Plant rather than between Product and Plant.
Interesting idea but would make the ongoing maintenance of data a little complicated. For now, I went ahead and customized the PBE to have a custom Plant lookup field. This allowed me to demonstrate my idea and complete the POC. Will circle back if decide to move forward. Thanks Rob!