Skip to main content

Questions tagged [opportunity-lineitem]

An Opportunity can have associated OpportunityLineItem records only if the Opportunity has a Pricebook2. An OpportunityLineItem must correspond to a Product2 that is listed in the opportunity's Pricebook2.

Filter by
Sorted by
Tagged with
-3 votes
2 answers
1k views

Display opportunities associated with an OpportunityLineItem [closed]

I'm trying to display opportunities associated with an OpportunityLineItem on a Visualforce page on the OpportunityLineItem object I have a problem in the select I do not know how to retrieve the ...
Anirbas's user avatar
6 votes
2 answers
1k views

java.sql.SQLException error caused by OpportunityLineItem DML request

In our Salesforce.com organization, we have a trigger on the OpportunityLineItem object (insert/update), automatically generating OpportunityLineItemSchedule. The product is schedule by revenue, ...
jpmonette's user avatar
  • 4,440
4 votes
3 answers
11k views

How to find out relationships for SOQL queries?

I want to construct a SOQL query displaying all Opportunities that are sorted by the Products that are associated to it. I however have a problem finding out how Opportunities and Opportunity ...
mcbetz's user avatar
  • 927
1 vote
1 answer
66 views

Automatically add ProductB once productA is manually added to Opportunity

I was trying to accomplish this through a trigger, but its not really working. Is there a way to get this done through Process Builder? If so, what is that process? I'm trying to have ProductB being ...
user avatar
11 votes
2 answers
4k views

Sorting Opportunity Line Items programmatically

I've been attempting to do a purely Apex based sorting of Opportunity Line Items based on a solution I found in the Salesforce developer boards. That solution uses a combination of Javascript and Apex ...
Alan Morey's user avatar
  • 2,451
3 votes
1 answer
2k views

Why can't I reference all Opportunity Product (OpportunityLineItem) fields in formula fields?

Salesforce's Spring '21 release finally offers Opportunity Product (OpportunityLineItem) lookups, which my organization has been waiting a long time for. However, we're having issues with our ...
Daniel Long's user avatar
2 votes
2 answers
3k views

OpportunityLineItem in test classes

I am trying to insert OpportunityLineItem record in my test class but unable to insert. Account acc = new Account(Name = 'Test'); insert acc; Opportunity oppObj = new Opportunity(Name = 'TestOpp',...
San's user avatar
  • 478
2 votes
1 answer
3k views

Get Opportunity with Opportunity Line Items

How can I use the salesforce api to get a list of opportunities such that each opportunity contains it's opportunity line items?
Ryan Gates's user avatar
2 votes
1 answer
312 views

different behaviour when adding opportunityline through visual flow?

To give some context, I had the requirement that I needed to guide the users through a couple of screens when closing an opportunity. So logically, I started implementing this requirement using ...
KoenVM's user avatar
  • 2,426
1 vote
3 answers
4k views

How do I update Opportunity Product with Product's Custom Fields Value

I have custom fields in Products. I want to populate these information in Opportunity Products. Any idea how this can be done?
Guddan's user avatar
  • 151
1 vote
2 answers
1k views

SOQL to update a field of an OpportunityLineItem in the opportunity in use

Trying to update an OpportunityLineItem, but need to be able to look for that particular product in the opportunity. Problem: SOQL is using the List Price from the product but from a different ...
user avatar
1 vote
2 answers
9k views

Pricebook entry currency code does not match opportunity currency code

I have a Visualforce page which create a product record, a priceBookEntry record and a opportunityLineItem record. I don't understand why in only one case, I get this error : In my code, I first ...
Oupat's user avatar
  • 733
0 votes
1 answer
550 views

Populating Opportunity custom field with MULTIPLE ProductOpp field values

Using the solution on SF StackExchange here I have created a Workflow Rule and Field Update to show the value of a custom field present on the OppProduct Level in Opportunity Level (as that field ...
TheAdmin's user avatar
  • 355
0 votes
1 answer
1k views

Sum of specific products in the opportunity

I have tried to figure out if there is a way to calculate the sum of specific products from opportunity products and display it in the opportunity object, but I haven't been very successful with that. ...
user avatar