Managing Quote Line Items using the Action Framework

  • 1
  • Question
  • Updated 4 years ago
  • Answered
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



Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
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. 
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
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?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
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. 
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
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!