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
SFDCDevQASFDCDevQA 

Custom fields for quotes from Opportunity products

So I'm having an issue in that our company uses custom fields in the opportunity products and we need these transferred over to the quote line items when making a quote but they system doesn't do that.  Does anyone have the code that salesforce uses to make the quote with line items and I could just tweak that a bit?  Or does anyone have custom visual force code or a trigger that I could tweak that would do the same?

Thanks,

Amanda

Best Answer chosen by Admin (Salesforce Developers) 
jroyaltyjroyalty

This may not be what you're looking for, but it seems like it might be it.

 

If you go under Setup | Customize | Quotes | Templates you can create a new template.  In that template you can change the Quote Line Items by clicking on the wrench at the right side of the sub-header bar, and add any fields that are available for Quote Line Items.

 

To add a custom field from an opportunity product so that it can be included in the line item, you'll want to look under Setup | Customize | Quotes | Quote Line Items | Fields and then create a New Formula field.  Then just set that formula to OpportunityLineItem.myvariable__c (Or whatever you want it to do to bring in the proper value.  Opportunity Line Items are opportunity products).  After you've created the custom variable, you can then insert it into the line items in the quote template as previously described.

All Answers

jroyaltyjroyalty

This may not be what you're looking for, but it seems like it might be it.

 

If you go under Setup | Customize | Quotes | Templates you can create a new template.  In that template you can change the Quote Line Items by clicking on the wrench at the right side of the sub-header bar, and add any fields that are available for Quote Line Items.

 

To add a custom field from an opportunity product so that it can be included in the line item, you'll want to look under Setup | Customize | Quotes | Quote Line Items | Fields and then create a New Formula field.  Then just set that formula to OpportunityLineItem.myvariable__c (Or whatever you want it to do to bring in the proper value.  Opportunity Line Items are opportunity products).  After you've created the custom variable, you can then insert it into the line items in the quote template as previously described.

This was selected as the best answer
Austin HorrocksAustin Horrocks
Can you elaborate on that syntax how you'd enter it into the formula field?  Example, quote object created and quote line item object added, how do you get the custom field for that product to populate the new field?  Call it Product2volume_c