Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
3answers
43 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
0answers
16 views

Import info into Opportunity Product Ojbect [closed]

Is it possible to just import product usage (I have a subscription based service) information directly into the Opportunity Product Object using SFDC's APIs.? And then have this information show up on ...
0
votes
1answer
23 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
21 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
12 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
38 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
28 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
75 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
15 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
18 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
141 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
48 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 ...
1
vote
1answer
139 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
75 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
22 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
24 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
29 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
95 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
70 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
74 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
81 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
12 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
54 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
520 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
257 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
130 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
300 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
160 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
36 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
51 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
491 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
86 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
290 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
285 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
55 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
58 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
323 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
260 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
235 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) { ...
0
votes
2answers
321 views

SOQL to get the last updated product in an opportunity

Trying to edit this SOQL so that it picks up the last updated product in an opportunity. Any idea how? Right now it is giving me the very first product that was created. PricebookEntry pbeProduct2 = [...
0
votes
0answers
125 views

Creating QuoteLineItem after creating Opportunity Line Item

I have created a webservice to create Opportunity, OpportunityLineItem and related Quote. When I do the same activity in configuration. QuoteLineItem gets created automatically. But when i do that ...
0
votes
2answers
1k views

Visualforce page to display opportunities along with their products

I am currently working on a Visualforce page to completely recreate and customize salesforce's 'customizable forecast' tab to make it work with our instance of CPQ as well as make a few business-...
0
votes
2answers
423 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 ...
0
votes
3answers
485 views

Create Asset record from data on OrderItem and OpportunityLineItem records

Scenario: When an Opportunity is closed/won, we are creating an Order record with the corresponding OrderItem records based on the OpportunityLineItems of the Opportunity. When the OrderItems are ...
0
votes
1answer
30 views

Method does not work without formula

I have an after insert method on OpportunityLineItem that I'm writing a test class for. A problem that I had is I couldn't get the test to assert on the list passed to it because a formula was null ...
1
vote
1answer
126 views

Locking “Quantity” and “Sales Price” once opportunity is WON

I have the following validation rule to prevent users from editing or creating products once the opportunity is won. The issue is that it can still be edited if they click on "edit all" in the ...
0
votes
1answer
162 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. ...
0
votes
1answer
60 views

Updating Product B value once Product A is edited in the product section of an Opportunity

The goal of the trigger is to automatically add "Product B" to the opportunity once "Product A" has been added manually by the Technical Writer. The code works really well, but I need Product B to ...
0
votes
1answer
64 views

Why does this Opportunity Trigger not work?

I wrote an Opportunity Trigger that should run when an Opportunity is Closed Won. This trigger should change the status of a custom object we use to record the status of subscriptions to specific ...
2
votes
0answers
209 views

How can I invoke Standard Action from lightning component? like opp add products

I want to call this page from lightning component.who can help me? Thanks.