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
1 answer
78 views

Getting FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice

I'm getting following exception while updating a custom field on Opportunity Product. FIELD_INTEGRITY_EXCEPTION:field integrity exception: TotalPrice (total price must be specified):TotalPrice Details:...
  • 31
1 vote
1 answer
61 views

Need Help Editing a Lightning Component Custom Search to show a second field in results

I have a custom Product search Lightning component on the Opportunity page and I need to change the second field in the search results below to display another field. Right now it shows the Product2....
0 votes
1 answer
28 views

Error While Cloning Products with Opportunity through Apex

I'm getting following error: List has more than 1 row for assignment to SObject Please find the code: //Clone Products Related With Opportunity OpportunityLineItem oppLineItemCloneRecord =...
  • 31
0 votes
0 answers
16 views

Oppty w/ product w/wo Schedules report showing No product or schedules But the opty has both

I made a report on Opportunity with products with or without schedules to see how many opportunities out there without a schedule sorted by Product Family. When I run the report, it shows a lot of ...
0 votes
1 answer
20 views

In which order are displayed Quote Line Items when SortOrder values are blank and order by SortOrder is selected?

In which order are displayed Quote Line Items when SortOrder values are blank and order by SortOrder is selected? We try to sort Quote line items in our custom package the same way how they are ...
  • 13.9k
0 votes
1 answer
21 views

Replacing OpportunityLineItem related workflows by one or more flows

Not a question, but my experiences, from which hopefully someone may learn something. Salesforce has announced that workflows and processes must eventually be replaced by flows. Our org has 4 ...
0 votes
2 answers
198 views

Record Types for Opportunity Product object?

It seems we are not allowed to create record types on the opportunity product object. I have a use case where I would like to show different fields based on the product type selected. Is there a ...
0 votes
0 answers
233 views

Field Integrity Exception: Unknown when updating a price in sandbox

In sandbox, I am trying to update a price for a product in the standard price book through the UI. When I change the List Price and click save, I get the following error. These are referencing ...
0 votes
1 answer
39 views

Hitting CPU Time Limit when bulk inserting OpportunityLineItems and its OpportunityLineItemSchedules

I have a VFP using which I upload a CSV file with several columns that consists of both OpportunityLineItem and its schedule related info. However, when I'm trying to upload the sheet, it is hitting ...
  • 25
0 votes
0 answers
27 views

How to best track opportunities by their products' "active" dates for a report?

Simply stated, my goal is to write an accrual report that lists all closed/won opportunities by each month (with each month including in an opportunity only if any of its products are active during ...
0 votes
0 answers
98 views

OpportunityLineItem shows UnitPrice with 3 places after decimal

I have an opportunity that has 3 products and each product has a list price of $600 and sales price (UnitPrice) of $400. The amount field on the opportunity is showing $1,199.99 instead of $1200 as ...
0 votes
0 answers
855 views

Pushing Custom Fields from Opportunity Line items to new Quote Line Items

So - I know there are some answers for this already in the form of a couple of apps available on the AppExchange, plus one from "douglascayers" which seems to do exactly what I'm trying to ...
0 votes
0 answers
176 views

Clone with related -- PricebookEntryId (pricebook entry is in a different pricebook than the one assigned to the opportunity): [PricebookEntryId]

I am getting this issue PricebookEntryId (pricebook entry is in a different pricebook than the one assigned to the opportunity): [PricebookEntryId] when ever I tried to clone an opportunity with ...
  • 59
0 votes
1 answer
445 views

Opportunity Product Lookup Field Not Displaying Unedited Opportunity Line Items

I have an Opportunity Product/Opportunity Line Item lookup-relationship on a custom object in my development sandbox. The custom object also has a lookup relationship to an Opportunity. When I try to ...
0 votes
2 answers
48 views

Unit testing on OpportunityLineItem

I need to write a unit test for a class that I have created. Mostly based on Opportunities and OpportunityLineItem. For some reason, I cannot get coverage past my for loop. I have tried everything, ...
0 votes
0 answers
15 views

I would like to receive the ID value of checked Opportunity Product within Opportunity and process it

We tried to get the ID value of the checked Opportunity Product in the Opportunity record and process it as Button. However, OpportunityLIneItem does not support StandardController on VisualforcePage. ...
  • 31
0 votes
2 answers
337 views

Using Custom Price Book Entry Object

I am developing the custom aura component for adding products to the opportunity for achieving client requirements. For this, I have created a custom price book entry object but while creating the ...
  • 145
-2 votes
1 answer
54 views

I want to create a task whenever I add or modify an opportunity product

trigger OpptyLineItem on OpportunityLineItem (after insert, after update) { if(Trigger.isAfter) { if(Trigger.isInsert && Trigger.isUpdate) { for(...
  • 31
0 votes
1 answer
369 views

Mass update on selected Opportunity Line Items?

In Classic I have a functionality where you select a couple of line items in an opportunity and then press one of four buttons to update a checkbox in each of those items (which fields get updated ...
  • 2,038
0 votes
0 answers
109 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,...
-1 votes
1 answer
34 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 ...
3 votes
3 answers
792 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
1 answer
869 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 ...
  • 73
1 vote
1 answer
51 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 ...
  • 730
0 votes
1 answer
23 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
1 answer
162 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 ...
  • 192
0 votes
0 answers
416 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
0 answers
61 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 ...
  • 41
3 votes
1 answer
908 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
1 answer
60 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
0 answers
232 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
0 answers
105 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
1 answer
119 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 ...
  • 473
0 votes
0 answers
128 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 ...
  • 192
0 votes
2 answers
1k 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
1 answer
333 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
0 answers
325 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 ...
  • 25
0 votes
1 answer
158 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 ...
  • 1
0 votes
1 answer
438 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 ...
  • 145
2 votes
1 answer
440 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
0 answers
295 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,268
1 vote
1 answer
724 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, ...
1 vote
2 answers
378 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
1 answer
1k 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 ...
  • 145
0 votes
1 answer
101 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 ...
  • 1
0 votes
1 answer
125 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,268
-1 votes
1 answer
695 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
1 answer
1k 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,458
1 vote
1 answer
709 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
2 answers
450 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 ...

1
2 3 4 5
7