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
0answers
36 views

Creating opportunity line from SalesforceSharp

I am using SalesforceSharp to create an Opportunity. The header is working OK, I have ensured that the CurrencyIsoCode and PriceBook2Id fields are set. When trying to create the Opportunity Line Item,...
0
votes
0answers
14 views

Add Products to Opportunity on the basis of Manufacturing Plant

The scenario is If suppose there are two products "A" and "B". Product "A" is manufactured in Plants X, Y, and Z, and the product "B" is manufactured in Plants ...
-1
votes
1answer
27 views

Adding MultiplePricebooks to an Opportunity [closed]

We have three different set of Prices for an Product . Lets say (Type A, Type B, Type C) and each type has three set of prices (List Price,Sales Price and Landing Price). We have a requirement to add ...
2
votes
2answers
320 views

Summer'21: OpportunityLineItem always empty for QuoteLineItem. Now how to fill QuoteLineItem custom fields?

While performing regression tests on a Summer'21 sandbox, I noticed that custom fields were not filled in newly created QuoteLineItems. For many years, I have used the trick as described here, and ...
0
votes
1answer
87 views

Opportunity LineItems is deleted when trying to sync quote

I am adding an Opportunity Line Item within my Apex code. When I create a Quote, I would like that quote to sync automatically and use the Opportunity Line Item and copy it in the Quote Line Item. I ...
0
votes
0answers
23 views

How do I customize fields displayed on the Add / Edit Opportunity Product Modal

Who remembers how to quickly and easily change the fields displayed on the Add / Edit Opportunity Product Modal (Popup Pop-up) in Salesforce Lightning?
0
votes
1answer
44 views

Better Code for Comparing Multiple Opps and All Their Products?

Trying to compare all Opps and their OLIs to see if there are duplicates (Opps with certain data that is the same, and all OLIs have same product and quantity) and then mark them as potential ...
0
votes
1answer
22 views

How to update associated planned date based upon the opportunity close date changed?

I have implemented a delivery delay for some of the opportunity line Item based upon the product family and opportunity close date. But now the business wants if a user changes the close date from 8-...
0
votes
1answer
38 views

The Query Cost of UPSERT

In an Apex Test, I'm getting the 'Too many SQL queries: 100' error. Quite a lot happens in the code that is called (it's an API endpoint, not just a single function) and in one scenario, the end point ...
0
votes
0answers
47 views

Creating an Opportunity Product (OpportunityLineItem) via REST API

I'm currently unable to create an OpportunityLineItem via REST API. I understood this was a standard object, but I can't see any reference to OpportunityLineItem when I do a GET on /services/data/v50....
0
votes
0answers
25 views

How to relate Opportunity Line Items to Contract LIne Items (in Service Contract)

I am quite a novice in Flow, and would like advice. My business case is to Relate Opportunity line items with Contract Line Items (in Service Contract object). When my Opportunity is closed/won with ...
1
vote
0answers
38 views

Attempt to de-reference a null object - Trigger to auto add products based on value in selected product

I'm working on a trigger for OpportunityLineItems that looks at the value for "add_for__c" for the product selected and if it is 0, it needs to find all other products in the same pricebook ...
0
votes
0answers
10 views

Use of contract item in SalesCloud

I have a question about contract object in sales cloud. Currently I'm working with manufacturing company. They have their own sales process. We are trying to implement their process to the sales cloud....
3
votes
1answer
106 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 ...
0
votes
1answer
21 views

Trigger to limit products being added across all opportunities

I have a use case where I need to limit the number of two products that can be added across all opportunities. For example "Product A" and "Product B" can only be cumulatively ...
0
votes
0answers
23 views

Cloning Opportunity Line Item does not add Product Schedule

I am trying to clone opportunity line items for an opportunity, and am able to clone successfully, get the price, quantity, pricebookentry, etc, but the Schedule does not transfer. Does anyone have ...
0
votes
0answers
17 views

How to remove ship to from opportunity product

I will add the opportunity product from the pricebook,I dont want the ship to field. While creating the new opportunity product, the field should not be visible and after saving the opportunity ...
0
votes
0answers
66 views

delete QuoteLineItem automatically delete OpportunityLineitem

I have a trigger whenever a quote is marked as primary then the QuotelineItem would copy the Opportunity line item. for insertion, it's working fine but during the checkbox is checked when I tried to ...
0
votes
0answers
48 views

Lwc file upload not working on opportunity line item

I am using the LWC file upload and it works fine on other objects but fails on the opportunity Line Item.It just states that it can not upload the image and throws no errors in the chrome console or ...
0
votes
1answer
36 views

OpportunityLineItem Trigger - Recursion -Product Dependency

I have a Custom Object(Product_Dependency__c) to define dependency between 2 Products with 2 lookup fields to Product. The first lookup is the Controlling product and the second is the dependent ...
0
votes
0answers
33 views

Opportunity Line Item UnitPrice Sometimes not updating in BeforeInsert trigger

In my BeforeInsert trigger for OpprtunityLineItemTrigger, I check if the product requires VAT (sales tax in the US) and add it to the UnitPrice if it does. This works most of the time, but sometimes ...
0
votes
2answers
235 views

How To Check For Duplicates Using SOQL and Apex

I am currently developing a csv importer for our Salesforce to deal with our way of quoting items, and I am currently trying to make it so that if the product has been added in, it detects whether ...
0
votes
1answer
118 views

Is it possible to have a list view of OpportunityLineItemSchedule?

I'm trying to create a list view of OpportunityLineItemSchedule but I have this error message Error: afterRender threw an error in 'lightning:listView' [[lightning:listView] Unsupported objectApiName:...
0
votes
0answers
220 views

OpportunityLineItemSchedules grouping by Date in SOQL

I have a list of products with associated schedules where each schedule has different Revenue and ScheduleDate values. I'm trying to get the get the aggregate of Revenue by DATE across the ...
0
votes
1answer
36 views

Test Class Opportunity Line Item, add error

I wrote a trigger to count the number of values in a multi-select picklist (custom_coins__c), if more than 10, error (too many coins selected). I'm new at writing code and can't figure out the test ...
0
votes
1answer
91 views

How to Prevent addition of product to opportunity in before insert trigger

The scenario is, there is a checkbox type field on Opportunity object called "Change_in_product_price__c". when this field value is 'TRUE' and When the user tries to add another OpportunityLineItem to ...
1
vote
1answer
174 views

“Start Sync” On Quote setting different Unit Price on Opporutuniy Line Item when Discount has many decimal places

When using the standard Start Sync button on a quote and having many decimal places in the discount, the Unit Price seems to change on the related Opportunity Line Item (OLI) attempting to be created. ...
0
votes
0answers
94 views

Testing OpportunityLineItem Error in Name?

I am having issues entering an OpportunityLineItem in a test class and getting the below error. System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, ...
1
vote
1answer
266 views

Add Products button not visible on Classic opportunity page

When you edit an opportunity page layout, you will see these options for the products related list: And in the edit page layout this looks like: However, when you actually look at an opportunity, ...
0
votes
2answers
225 views

How to pop-up the Edit Products/MultiEdit modal window via Aura?

The Edit Products/MultiEdit window is a pop-up in Lightning, so it cannot be shown by navigating to a particular URL, as was possible in Classic. How can I pop-up this window via Aura Javascript code?...
0
votes
1answer
506 views

Tracking Field History on Opportunity Product?

I currently use Opportunity Products for all our opportunities. I know that we currently cannot track changes on the opportunity product fields. Is there something that someone has already created to ...
0
votes
1answer
23 views

Adding second product to an opportunity if a specific product is first added

I have 65 products all under the same family spread across 4 sub families. Product 01-20 = SubFamily1 / Chair Product 21-40 = SubFamily2 / Desk Product 41-60 = SubFamily3 / Conference table Product ...
0
votes
1answer
71 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 ...
-1
votes
1answer
407 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
511 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
325 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
239 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
1answer
1k 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
494 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
658 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
29 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
674 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
2answers
137 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
1k 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
193 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
319 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 ...
1
vote
1answer
784 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
29 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
24 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
1k 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....

1
2 3 4 5
7