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
1 vote
1 answer
29 views

List has no rows for assignment to SObject while writing test class for opportunitylineitem

My test class: @isTest private class opplineitemHandlerTest { @isTest static void testCalculateTotal() { // Create test data Pricebook2 standardPricebook = [SELECT Id,Name ...
Sridhar's user avatar
  • 61
0 votes
0 answers
43 views

Bulkification not working for Before Delete Record Triggered Flow

Issue: The flow works for single record delete scenario, but not in the bulk record delete scenario. It is written with assumption that Flows Bulkification is taken care by salesforce in these ...
Kushal Malu's user avatar
0 votes
0 answers
39 views

Opportunity Multi-Line Custom Filter Without Custom Code

The business would like either a toggle that can filter opportunity products, instead of using the quick filters. Or a button that uses predefined filters. As much as we are pushing back because this ...
disasterlooms's user avatar
0 votes
0 answers
30 views

How to record upcoming supply

I am relatively new to the Salesforce world. I currently have an issue on my plate that I would like to ask you for help with. I have an opportunity that should cover several things: Manufacturing: A ...
Windowsfan's user avatar
0 votes
0 answers
190 views

Automating Addition of Product to Opportunity Line Item in Salesforce Using Flow and Apex

I'm working on developing an automation process in Salesforce and could use some guidance. My goal is to automatically add a product to an existing opportunity line item list, associated with a ...
Jean-Luc KABORE-TURQUIN's user avatar
0 votes
1 answer
75 views

How can I get around the "too many SOQL queries" error in my flow?

All, Not new to flow at all but can't figure out a workaround for this. I have what I believe to be a simple flow. It queries the OpportunityLineItem object to see if a record has any ...
jdids's user avatar
  • 275
0 votes
1 answer
633 views

How to auto-calculate discount when adding products

When adding line items on an opportunity, after you select the product(s), the screen to enter the sales price, quantity and discount are shown. I've also added the list price, which is a read only ...
user1718612's user avatar
1 vote
0 answers
173 views

Visualforce Add Products page in Lightning is redirecting to a blank page

I'm currently working on a migration to Lightning where we have some Visualforce pages, specially in Opportunity. We are currently facing an issue when trying to open the standard Add Products or Edit ...
Federico Giust's user avatar
0 votes
3 answers
2k views

How can a flow access an opportunity's product?

I need to access opportunity products through a flow, and I don't know how... I tried point at the product ID, but of course, it doesn't work. Can you help, please?
Sebbie's user avatar
  • 91
0 votes
1 answer
94 views

Apex Test insert is not setting a field on the record

In my Test class, a custom field is not set when inserted: The field Product_Family__c on OpportunityLineItem, while inserted, is missing when queried. @isTest public class tempTest { @isTest ...
Brian Hopkins's user avatar
0 votes
0 answers
581 views

Need to populate text values from related object to parent object text field

The requirement was whenever a product is added to an opportunity the product's product family text values need to be populated in the opportunity object itself in a custom text field named ...
Logan Reddy's user avatar
0 votes
1 answer
283 views

URL hack for Add Products button in Lightning

The following button code opens the Add Products screen in Classic: /ui/opportunity/SelectSearch?relatedListId=PricebookEntry&addTo={!Opportunity.Id} Is there a Lightning equivalent? Bonus points ...
Andrew Jones's user avatar
0 votes
2 answers
2k views

How can i launch the Add Products pop-up from a flow after creating an Opportunity?

I've built a screen flow to create new opportunities and after saving i would like to be redirected to the Opportunity that i just created and the Add Products pop-up should also open. I was able to ...
Nuno's user avatar
  • 1
0 votes
1 answer
276 views

Disappearing Opportunity Products

We have an issue that opportunity products are deleted by some kind of process / apex whatever. What would be the best way to debug this? We tried delta checking with the backup system tried to log ...
coffee_bear's user avatar
0 votes
1 answer
1k views

Custom Field Not Showing Up for Opportunity Product

I would like my sales team to see a custom field — Unit of Measurement (UOM), which is a pick list — for each product when they’re adding it to an opportunity. I have added the UOM field to the ...
acs254's user avatar
  • 101
0 votes
1 answer
194 views

Opportunity Quick Action is unable to display Opportnity Line Items using Screen Flow

I have an issue where I create a screen flow for the Opportunity object that would create one of 3 types Refund records base on a button click: a) Direct, b) Credit, and c) Duplicate. Direct Refund ...
Anthony Williams's user avatar
0 votes
0 answers
300 views

Bizarre Flow error when deleting records that were queried: ENTITY_IS_DELETED

I have a Platform-Event Triggered Flow which does the following: After insert of a Platform Event record... Get OpportunityLineItem records related to an Opportunity If the result of the above query ...
JustinF's user avatar
  • 485
0 votes
1 answer
956 views

lwc clone an opportunity product using record-edit-form

I have a LWC called Opportunity Product Manager which shows all the opportunity products. Each Opportunity Product is a LWC itself which has 2 buttons: Edit and Clone. Pressing on these buttons open a ...
sfdcdev's user avatar
  • 389
-1 votes
2 answers
1k views

Is there an Out-of-the-Box way to sum all Opportunity Products related to an Opportunity?

I am trying to sum the 'Total Price' of related Opportunity Products for a given Opportunity. I would like to then display that value on the Opportunity Page Layout. Is there an Out-of-the-Box way to ...
sp2's user avatar
  • 77
1 vote
2 answers
550 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....
JohnM at ABPM's user avatar
0 votes
1 answer
187 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 =...
Rose 's user avatar
  • 123
0 votes
1 answer
623 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 ...
Patlatus's user avatar
  • 17.3k
0 votes
1 answer
54 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 ...
Sander de Jong's user avatar
0 votes
2 answers
1k 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 ...
user1669296's user avatar
0 votes
0 answers
1k 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 ...
salesforceheather's user avatar
0 votes
1 answer
63 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 ...
SMorse's user avatar
  • 39
0 votes
0 answers
123 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 ...
Nathan Hedman-Copp's user avatar
0 votes
0 answers
402 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 ...
user1669296's user avatar
0 votes
0 answers
2k 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 ...
Jshrewey's user avatar
0 votes
0 answers
508 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 ...
klnavi's user avatar
  • 79
0 votes
1 answer
1k 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 ...
Cleverlemming's user avatar
0 votes
2 answers
165 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, ...
Y_m5437's user avatar
0 votes
0 answers
30 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. ...
Hwang's user avatar
  • 31
0 votes
2 answers
818 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 ...
jsmith's user avatar
  • 185
-2 votes
1 answer
114 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(...
Hwang's user avatar
  • 31
1 vote
1 answer
1k 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 ...
Semmel's user avatar
  • 2,507
0 votes
0 answers
214 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,...
Dominic Cotton's user avatar
-1 votes
1 answer
42 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 ...
Anonymous123's user avatar
3 votes
3 answers
1k 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 ...
Sander de Jong's user avatar
0 votes
1 answer
2k 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 ...
Eric's user avatar
  • 73
1 vote
1 answer
54 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 ...
number41's user avatar
  • 980
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-...
Samuel Robert's user avatar
0 votes
1 answer
355 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 ...
cyberspy's user avatar
  • 210
0 votes
0 answers
984 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 ...
Pauline O's user avatar
1 vote
0 answers
91 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 ...
Heather's user avatar
  • 41
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
0 votes
1 answer
154 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 ...
Harry Niko's user avatar
0 votes
0 answers
586 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 ...
starboy The's user avatar
0 votes
0 answers
194 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 ...
zachary edgell's user avatar
0 votes
1 answer
182 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 ...
Raphael D's user avatar
  • 616

1
2 3 4 5
7