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
0
votes
1answer
17 views

Dated Exchange rates and Product Schedules

Can someone explain how this works in practice? Quote the SFDC: Dated exchange rates are used for opportunities, opportunity products, opportunity product schedules How does this look? For ...
-2
votes
1answer
41 views

Add a picklist value to Global Value Set in test class

I am working on test class that inserts an Opportunity with the opportunity products using the correct price book/price book entry. The OpportunityLineItem has a ProductSelected__c picklist field. We ...
1
vote
1answer
52 views

I cannot update the unit price field on OpportunityLineItem

I am trying to update the UnitPrice on the OpportunityLineItem object; however, it does not update the field, my code is as follows: Id oliId = '00k1w000006SpWE'; OpportunityLineItem oli = [SELECT ...
1
vote
1answer
37 views

Re-parenting primary CPQ quote Line Items not rolling up to Opportunity

Within CPQ, Opportunity Line Items should automatically sync with the Primary Quote's Line Items. However, when re-parenting a primary quote from a Source Opp to a Destination Opp (Destination Opp ...
1
vote
2answers
41 views

VISUALFORCE - Sort Opportunity line items as they are displayed

I have a visual force page that uses the apex:repeat to loop through the Opportunity line items. But the order is not as it displayed in the Opportunity. I can check the SortOrder value of the line ...
0
votes
0answers
71 views

How to transfer Opportunity Line Items to Quote with Flow

I have a custom New Quote button which has some pre-defined fields when creating a quote from an opportunity. I learned it the hard way, that using such custom actions, the Opportunity Line Items will ...
0
votes
1answer
57 views

How to display validation rule error message for opportunity multi line layout?

I am have requirement to display error message while adding opportunity products in multi line layout. i have created validation rule with respect to condition on custom fields which are added to ...
0
votes
1answer
65 views

Query only OpportunityLineItems whose opportunity is open

I am very new to writing SOQL or APEX triggers I am currently writing an APEX trigger, that would update OpportunityLineItems whenever a Product2 is updated. Basically, it currently looks like this. ...
1
vote
1answer
25 views

Apex Batch Test Class for Opps with OLIs not returning values

I'm struggling with an Test Class for a little batch I created, let me clarify that I'm not a developer, so any tips will be appreciated. I wrote 2 versions of the class, the first gives me about 94% ...
-3
votes
2answers
151 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 ...
0
votes
0answers
24 views

Opportunity product - Related list

I created a custom object : Discount__c ,that I want to link to Opportunity Product to see in each opportunity product all the discounts that there are on this product. Unfortunately we cannot ...
0
votes
2answers
59 views

how to create a trigger that will run when any opportunity line item is added or deleted from the opportunity? [closed]

I am new to apex programming and trying to learn it these days. I want to create a trigger that will run every time an OLI is added or removed from the opportunity. Which standard object is ...
1
vote
3answers
291 views

How to allow OpportunityLineItem delete but not Opportunity delete

How can I stop users from deleting Opportunity's but allow them to delete OpportunityLineItems? Because OpportunityLineItem is a child record of Opportunity it is not possible to control it's object ...
0
votes
1answer
34 views

OpportunityLineItem formula field is not getting correct values in Test class

I have a formula field in OpportunityLineItem -'Is Available'(IsAvailable__c) which takes values from product object's checkbox field -'Is Available' FORMULA : PricebookEntry.Product2.IsAvailable__c ...
1
vote
0answers
51 views

Selecting the Opportunity Price Book

I'm still fairly new to Salesforce Apex and trying to figure out how to select a price book from the opportunity. The reason being I have a trigger which adds in a product when the opportunity is ...
0
votes
0answers
33 views

after adding product to opportunity line item, the product do not display until and unless refresh the page

I have Embedded the Visualforce page on the Add Product button in lightning experience. when I am adding the product to opportunity, after adding I need to manually refresh the page again to appear ...
0
votes
0answers
194 views

Opportunity Line Item's Unit Price(quoted price) field update from related Product custom field

I have a requirement to update the Unit price(quoted Price) field of an Opportunity Line Item from the related Product Object custom field. And I need to perform this update when I am creating the ...
0
votes
0answers
40 views

Select Opportunity Product Instead re create them

I have a dynamic picklist (SelectOption) of PricebookEntry Which I build with a SOQL after selecting a product. after selecting few PricebookEntries - I need to create a new Opportunity and insert ...
1
vote
1answer
278 views

Formula on List Price for specific products

How can I use a formula to calculate list price based on custom fields for certain products? I though I could I set the list price at 0 since it's required then create a process builder to update the ...
0
votes
0answers
22 views

Dependent Opp Product

I have 4 new products to add, however 3 of them are dependent on the 1 other one being sold. How can I prevent sales reps from adding the 3 dependent products without adding the "parent" product above ...
0
votes
1answer
20 views

How to store only product type/range on Opportunity when specific product choice unknown?

Because it's not possible to change a product once added to an opportunity, what's the standard way to store product family, qty, specifications, etc. while customer decides on the specific product? ...
0
votes
1answer
431 views

Change the product of opportunity line item?

I am writing some code in apex that checks opportunitylineitems. In my code I am trying to clone some line items but change their product, but I cannot seem to. Code below: if(oli....
0
votes
1answer
74 views

How to copy Lead related objects to Opportunity when Lead Converted

I would like to copy all related Lead Products from Lead to OpportunityLineItems for the Opportunity when the Lead is converted. I thought there might be a base Apex class I could extend to ...
3
votes
1answer
952 views

How to customise columns in Add Products popup

Question How do I customise the columns that appear in the Add Products popup which appears if you click the Add Products button on the Products related list on the Opportunities record page? What I'...
2
votes
1answer
295 views

Update of quantity is modifying Sales Price but not Total Price

Can anyone help me out in understanding the below functionality. When i am trying to change Quantity on OopportunityLineItem, SalesPrice is getting change but not the Total Price. For Ex - Sales ...
0
votes
1answer
31 views

Divide OpportunityLineItem Quantity Schedule Evenly

I have a requirement where we need to insert OLIQuantity Schedule automatically. I need to divide the quantity evenly to the duration given. Like if Duration = 3 and productQuantity = 11, i need to ...
0
votes
0answers
42 views

unable to update UnitPrice field in Opportunity line item

I am executing following code to update UnitPrice in Opportunity line item: OpportunityLineItem oli = [SELECT UnitPrice FROM OpportunityLineItem WHERE Id = '00k8E000007TzxjQAC']; oli.UnitPrice = 10; ...
0
votes
1answer
54 views

Trying to do an SOQL Query for all product names and their Price books

I Have a Salesforce Org where there are almost 1000 products and 51 Price books, I want to know a query where I can get each product and the price books they belong to. Any help is much appreciated!
1
vote
1answer
230 views

How to overcome the lack of record type in opportunity Product?

I have a custom field in Opportunity Product called 'Unit of Measurement' and what I am trying to do is, show one value "Meter" as the default for users of one profile and "Square foot" as the ...
2
votes
1answer
169 views

How to calculate Custom TotalPrice in OpportunityLineItem

I have an scenario where I want an custom calculation for field "Totalprice" on OpportunityLineItem. I have written a trigger on OpportunityLineItem where first I am setting the UnitPrice value on ...
1
vote
0answers
110 views

Opportunity Product Lookup Filter [closed]

I was trying to replicate an object fields in my developer org and i came up with an object(which is a part of managed package) and a field of it has Lookup Relationship with Opportunity Product. How ...
1
vote
1answer
140 views

How are QuoteLineItems related to OpportunityLineItems

How does the QuoteLineItems Generated from the OpportunityLineItems, Can I add Fields that It can copy? How? I'm looking for a way to add fields to copy from the opportunity items to the quote items, ...
0
votes
1answer
13 views

Test button's action that adds OpportunityLineItem

I have a problem with one code's part. Controller (a part): public void click(){ for(WrapperClass wrp : wrapperRecordList){ if(wrp.isSelected){ ...
0
votes
1answer
120 views

If statement based on created by profile name to show value is custom formula field

This new field will be called "Line item Total Test" on Opportunity Product. This Formula is not working- IF(CreatedBy.Profile.Name = "Standard User", TotalPrice), IF(CreatedBy.Profile.Name = "...
1
vote
1answer
829 views

Are quote line items automatically created when inserting a quote in apex

I was reading this trailhead and it says quote lines are automatically created from the opportunity products when a quote is created. At this point, he selects the quote, and he sees that the ...
7
votes
1answer
342 views

SLEEPY Strikes again - Validation bugs

I've got a class which uses a wrapper class to handle OpportunityLineItem's which both have ids and don't have an id. Before calling an upsert on these records to update them, I extract the records ...
-1
votes
1answer
213 views

Trying to write a SOQL query that will pull the “product” name from the PricebookEntry on an opportunity line item

SO to clarify, The "name" on the OpportunityLineItem doesn't contain just the actual SKU, which is the "name" of the product. What I need to do is peel the onion back one more layer, and pull the ...
0
votes
1answer
500 views

Associating Asset records with Opportunity Product records

Our org has been storing serial numbers in an arbitrary text area field in the Opportunity Products object, delimited by arbitrary characters (commas, newlines, spaces, etc). This is very bad for a ...
1
vote
2answers
249 views

Aggregate result delete issue in trigger

Requirement : There is rollup (Sum) between opportunity and opportunitylineitem. Insert and update event is working fine but for delete event is not working correct. I have one opportunity and one ...
0
votes
1answer
37 views

List out of bounds 0 exception

I am trying to change the Opportunity Line Item schedule when a custom field is changed. The schedule works fine when the field is enterd, but when I edit the custom field it throws the exception. I ...
0
votes
1answer
67 views

Why does this Opportunity Validation Rule Evaluate to “Error”?

Validation Rule: GP_Locked__c && ISCHANGED(Total_GP__c) We are only editing the opportunity record, Ticking the GP_Locked__c Field (Boolean), for the purpose of locking the $GP amounts. And ...
2
votes
2answers
871 views

Automatically Linking Opportunity Product to Asset in Process Builder

I'm trying to create a process linking multiple Opportunity Products to an Asset, So that we can use it to know which products are part of what Asset. So far, this endeavour has multiple steps ...
0
votes
1answer
119 views

Adding a custom field from OppLineItem to a custom report type

I have a custom field on the OpportunityLineItem and want to show it in a custom report. Current setup: Custom Report Type: Invoices with Asset OpportunityLineItem- child of Opportunity Invoice - ...
0
votes
0answers
428 views

Lightning Action on Opportunity Product

I need to add a Lightning action on Opportunity Product. After some research, I have found that it is not possible. Anyone ever got this issue? Any workaround?
0
votes
2answers
511 views

Trigger to update fields on record create or edit

I have a trigger on the OpportunityLineItem object that we use to update 4 revenue fields with specific calculations when the record is either created or updated. For some reason it seems the trigger ...
-2
votes
1answer
84 views

iam inserting an Opportunity record, but I need it to have HasOpportunityLineItem = true (HasOpportunityLineItem read only field)

iam inserting an Opportunity record, but I need it to have HasOpportunityLineItem = true (HasOpportunityLineItem read only field) present HasOpportunityLineItem = false but i need to ...
0
votes
0answers
77 views

QuoteLineItems Stop Adding Opportunity Products

We need to be able to add opportunity products without adding them to the quotelineitems. This is because our special pricing desk needs to inspect each product before it is added to an appended ...
-1
votes
1answer
404 views

Find duplicate opportunity with process builder

I am working on a requirement when a "deal" opportunity is closed, we need to create a "target" opportunity if a target opportunity does not exists in the system (Deal and Target are the record types)....
0
votes
1answer
392 views

Validation rule on OpportunityLineItem (opportunity product)

On a visualforce page, I am creating an opportunity and I am adding an OpportunityLineItem (opportunity product) to it. The product2 linked to the opportunity product has a field called ...
-4
votes
2answers
334 views

How to solve Error: Compile Error: Field is not writeable error for ListPrice Field on opportunity Line Item

I am trying to assign the List Price field on OpportunityLineItem to 0 using trigger but receiving the Compile Error as: Field is not writable error. for(OpportunityLineItem oli: trigger.new) { ...