Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have question on opportunity and opportunity product. I have a requirement where i need to store all the different services provided by us for each opportunity. I am trying to accomplish this by creating a custom object. Exploring sf, i see the opportunity product, but don;t know what it is used for. Please throw some light.

share|improve this question

Opportunity Product (API name OpportunityLineItem) is a Junction Object between Opportunity and Product2 .

An opportunity has to be linked to the Product for generating order or to do Quote management going ahead .The products linked to opportunity are known as opportunity line Item or opportunity product .The revenue is the sum of prices of these line items .

Have a look at sales data model from SFDC to explore more

enter image description here

share|improve this answer
So does it mean that i can save the different services provided by one opportunity here, why i am asking this is, i need to generate report on the services that are won or lost on each opportunity. As it is a junction object, can i still add my custom fields to this. Please help. – user8132 Jul 31 '14 at 20:00
Yes you can add fields to it .You can create custom fields on opprtunity Products. – Mohith Shrivastava Jul 31 '14 at 20:06
I set up look for opportunity Products and add a custom boolean field or picker and you can use out of box object. – Mohith Shrivastava Jul 31 '14 at 20:08
i created few products, now i am trying to create the opportunity lineitem for an opportunity, how to create the lineitems for the opportunity? – user8132 Jul 31 '14 at 21:26
i need to enter the services(opportunity line item) as few fields keeps changing every time, like from, to,number of prices. How to achieve this – user8132 Jul 31 '14 at 22:03

Actually, Opportunity Product (OpportunityLineItems) is a junction between Opportunity and Price Book Entry (PricebookEntry). The Pricebook Entry is itself a junction between Product (Product2) and Pricebook (Pricebook2).

As for your requirement, it sounds like you're supposed to store every service you offer on an Opportunity even if it's not being sold on that Opportunity. Is that correct? If so, it doesn't sound like a requirement that has been fully thought through. Why not only store the services being sold on that Oppty?

If that is the requirement and it somehow makes sense, then you could use Opportunity Products and create a trigger on Insert that gets all available Products and creates a OpportunityLineItem for each.

share|improve this answer
The requirement is to store the services offered by one opportunity, but the services are so different, like domestic and international. for domestic services, the fields are different and for international services, the fields are different. So where do u suggest to store these field values, in opportunity or opportunity product or product2. I am new to sf, trying to use the existing functionality, instead of creating custom objects. In the same way, i am trying to understand the existing features of sf, please excuse my ignorance – user8132 Aug 1 '14 at 13:47
Would you sell domestic and international services on the same Opportunity? If not, then you would create two Record Types on the Opportunity, one for Domestic and one for International. The additional questions can be fields you create on the Opportunity instead of on the Product. – cwarheit Aug 4 '14 at 21:11
yes we sell domestic and international in the same opportunity also we need to facilate to sell other 8 services on the same opportunity – user8132 Aug 5 '14 at 16:34
I would still recommend putting the fields on the Opportunity object. Then in the layout, you could create sections for International and Domestic. Since you can't recordType OpportunityLineItems, it would certainly not be ideal, even if the fields were Service specific. Any field you add to Opportunity products would be on every product. – cwarheit Aug 7 '14 at 18:35

You should think about Opportunity Products as either

a) SKU(s) that you would quote and then, if ordered, receive a Purchase Order with line items for those SKU(s). You can also forecast by SKU this way

For example, if I were Dell, one of my Opportunities might have these Opportunity products

  1. LAT-7440-16GB
  2. MONITOR-27
  3. SATA-1TB


b) Product Families that you sell one or more of on a given Opportunity (and where you want to do opportunity-product forecasting on)

For example, If I were General Electric, one of my Opportunities might have multiple Opportunity products:

  1. Jet Engines
  2. Support and maintenance
  3. Professional services
  4. TurboJet engines
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.