+ Start a Discussion
Robbi ConverseRobbi Converse 

Reference Opportunity Products on Custom Object

I have a custom object "Service Agreement" and need to reference the Opportunity Products on that object when the Service Areement is created from an Opportunity. (It is my understanding that these will update when a quote is synced...please correct me if I am wrong.) The bottom line is that I need the agreed upon products and associated information (price, qty, etc.) on the Service Agreement. My deadline is looming and I just can't figure this out.
Best Answer chosen by Robbi Converse
Tarun Khatri (TK)Tarun Khatri (TK)
Yes, it requires Trigger to fetch values from OpportunityLineItem. You can hand it over to your Developer team.

All Answers

Tarun Khatri (TK)Tarun Khatri (TK)
Hello Robbi,

When you insert a Service Agreement record from opportunity, you get reference to Opportunity Id. You can query on OpportunitylineItems to get the list of products associated with Opportunity. You can update fields on Service Agreement record with product values.

-Thanks,
TK

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Robbi ConverseRobbi Converse
I don't quite understand. When I am creating a field on the service agreement (Service Agreement -> Opportunity), OpportunityLineItems isn't a field option.
Tarun Khatri (TK)Tarun Khatri (TK)
There is no option of OpportunityLineItem type on field creation. OpportunityLineItem is an Object.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_opportunitylineitem.htm

You need to create custom field on Service Agreement object with the matching data types of OpportunityLineItem. Those fields need to be populated with the values of related OpportunityLineItem record using Trigger on creation of Service Agreement record.

-Thanks,
TK

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Robbi ConverseRobbi Converse
I cannot find OpportunityLineItem Object anywhere to see what data type it is or to relate it to the Service Agreement. However, there is one word in your answer that concerns me and that is "trigger." I haven't worked with triggers at all. If that is the only way to do this, I will need truly step-by-step instructions or I will have to hand off to a more experienced admin or developer.
Tarun Khatri (TK)Tarun Khatri (TK)
Yes, it requires Trigger to fetch values from OpportunityLineItem. You can hand it over to your Developer team.
This was selected as the best answer