Skip to main content
9 votes

STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product: []

Since Summer 14, it's been possible to Create Price Book Entries in Apex Tests irrespective of the state of SeeAllData: Id pricebookId = Test.getStandardPricebookId();
Fábio Lupo's user avatar
5 votes
Accepted

Pricebook and PricebookEntries with different currencies

One Pricebook can have multiple Pricebookentries for the same Product2. Example Pricebook2: MyCustomPricebook Product2: MySKU PricebookEntries MyCustomPricebookId MySKUId USD 10.00 ...
cropredy's user avatar
  • 72.1k
4 votes
Accepted

SOQL query to retrieve Quote Line Item records from Quote Record

In a parent query , you can use a child sub-query, formally known as a Left Outer Join: SELECT Id, (SELECT Id FROM QuoteLineItems) FROM Quote WHERE ... As a separate query: SELECT Id FROM ...
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

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

It does not. In Apex, you need to explicitly create and insert the QuoteLineItem objects you want, providing the QuoteId and PricebookEntryId lookup values and the Quantity and UnitPrice.
David Reed's user avatar
  • 93.2k
3 votes
Accepted

How can i refer QuotelineItem fields from Quote Object?

No, you can't build formulas on child objects. You could use a trigger or rollup summary field to transfer the information up to the quote, which you could then reference in a formula.
sfdcfox's user avatar
  • 497k
3 votes

SOQL query to retrieve Quote Line Item records from Quote Record

Here is the syntax from Parent to Child:- SELECT Id [Fields...,] , ( SELECT Name, [..Fields,] FROM QuoteLineItems ) FROM Quote WHERE Id=:Quote_ID Child Relationship name of Quote Line ...
Ashwani's user avatar
  • 22.6k
3 votes

Does Quote Line Item reference back to which OLI it relates to?

With API version 40.0 , there is new "OpportunityLineItemId" field which tracks the opportunity line item the quote line item is created from. https://developer.salesforce.com/docs/atlas.en-us.api....
Mitesh Sura's user avatar
2 votes

Need help On Quote Line Item

tl;dr version: I don't think what you're asking for is feasible, and you (or your manager) need to rethink your requirements (as well as doing some independent research). long version: This is a ...
Derek F's user avatar
  • 62.8k
2 votes
Accepted

How to query the customfield in the OpportunityProduct by apex?

Points which were helpful for you in solving the problem... Opportunity Product is the object which shows list of Products related to an opportunity. We refer it as OpportunityLineItem in code. ...
Mr.Frodo's user avatar
  • 5,812
2 votes

Syncing custom fields between QuoteLineItem and OpportunityLineItem

It seems like "OpportunityLineItemId" field on Quote Line Item object is a special field. SELECT Id, OpportunityLineItemId FROM QuoteLineItem WHERE QuoteId ='0Q01N00000xxxxxxx' AND ...
Mitesh Sura's user avatar
2 votes

Steelbrick - how to add product options when selecting product bundle in Apex

I don't think there is any need of checking the API. What you can do is, 1) Query the Product Option object and see if the product you are trying to add as the line item is a Configured Product ...
Shailesh Patil's user avatar
2 votes

FIELD_INTEGRITY_EXCEPTION, The price book entry is in a different price book than the one assigned to the Quote, or Quote has

In the part of the code where you're creating the quote, you need to assign the Pricebook2Id field. q.Pricebook2Id = opp.Pricebook2Id;
sfdcfox's user avatar
  • 497k
2 votes
Accepted

Approval process not assgining to correct approver , Approval process not working as expexted!

in your condition first else is "Approve" so it wont execute 2nd and 3rd step Your approval Steps should be like this : step 1 : check if its >10 then send to manager else "next step". step 2 : ...
patelkiran3090's user avatar
2 votes

Admin trying to add Field History Tracking to Quote Line Items, Insufficient Privileges?

Apparently, you can't yet track field history on quotes (and presumably quote line items). Only the standard objects in the documentation you've looked at support this feature. See this Idea.
sfdcfox's user avatar
  • 497k
2 votes
Accepted

Can't Access Quote Line Items through Quote Object in Process Builder

You can't query child records from process builder. You'll have to use a record-triggered Flow, since flows can query and loop through child records.
David Cheng's user avatar
  • 7,154
2 votes
Accepted

Opportunity LineItems is deleted when trying to sync quote

The doc on how quote sync works doesn't really get into the nuances much. There's some different scenarios not explicitly called out that occur below: If you create a Quote from an existing ...
Kris Goncalves's user avatar
2 votes
Accepted

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

Here is the trigger that solves the problem for our org. Note: our org has the special property that all Opportunity Line Items have unique ProductCodes within one Opportunity (we have Apex code that ...
Sander de Jong's user avatar
1 vote
Accepted

Single SOQL query to list ALL Products with ALL Quote Line Items and ALL Order Products?

As you can see from Workbench, there are no relationshipNames for Product2 to OrderItem and Product2 to QuoteLineItem. Yet you can query from Product2 to PricebookEntry However, you can query from ...
cropredy's user avatar
  • 72.1k
1 vote

Pricebook and PricebookEntries with different currencies

Price books do not have a currency (there is no CurrencyIsoCode field). Salesforce includes special behavior that allows only one product per currency per price book. In other words, a price book ...
sfdcfox's user avatar
  • 497k
1 vote

Add multiple Item on quotes with VF Page by a Button

I was thinking of calling a VF page from a button that would add all lines of items from my Construction line Because of salesforce limitation, you cannot do insert/update/delete aka DML inside the ...
Pranay Jaiswal's user avatar
1 vote
Accepted

QuoteLine Item Standard object "Discount"

You need to set the value to 1, not 100. This is because internally, percentages are expressed as being a decimal percentage. This is what allows you to write Discount * UnitPrice, for example, to ...
sfdcfox's user avatar
  • 497k
1 vote

Failure when inserting records via dataloader, however anonymous apex inserts fine

Check your usage of the QuoteLineItem.Product2Id in data loader. From the docs for Product2Id: Required. ID of the Product2 associated with this QuoteLineItem. In API 38.0 and earlier, if ...
Daniel Ballinger's user avatar
1 vote

How are QuoteLineItems related to OpportunityLineItems

QuoteLineItems and OpportunityLineItems are not directly related. Look at this ERD for Product and Schedule Objects from the SOAP API Developer Guide. You can grab the idea of how these object ...
Eduard's user avatar
  • 5,181
1 vote
Accepted

Illegal assignment from List<Quote> to List<Quote>

I suspect you have a class or variable named Quote. For this reason, I always recommend you don't name classes or variables that are literally the same as a standard object. However, for now, you can ...
sfdcfox's user avatar
  • 497k
1 vote

FIELD_INTEGRITY_EXCEPTION, The price book entry is in a different price book than the one assigned to the Quote, or Quote has

I'm not familiar with these objects. But relating your error message to the Product and Schedule Objects ERD, it appears you need to specify a PriceBook2Id on your Quote (probably taken from the ...
Keith C's user avatar
  • 136k
1 vote
Accepted

Cloning Opportunity with Synced Quote and its Quote Line Items

Okay I figured this out. Turns out there's a process that gets called in our organization when I insert the Quote Line Items, which because I was inserting the Quote Line Items before giving the ...
Nate Briggs's user avatar
1 vote
Accepted

Where do Existing Quote Records Go after Quotes are Disabled?

I just tested this in my developer org, and the answer is apparently: nothing. The object itself is disabled, but the quote records do not "go" anywhere. I've turned it off and on a few times, and no ...
sfdcfox's user avatar
  • 497k
1 vote

Steelbrick - how to add product options when selecting product bundle in Apex

Instead of doing manually by writing your own code, check with the steelbrick (which is now Salesforce CPQ), Is there any API available which you can use here. where you can configure the Bundle ...
user2809299's user avatar
1 vote

Quote Line Item Description vs Product Description

Rich text will not render as Rich Text in a PDF Template. This is a known limitation of the PDF Render Engine. See Visualforce PDF Rendering Considerations and Limitations for more on this. The PDF ...
crmprogdev's user avatar
1 vote
Accepted

Make UnitPrice read Only using triggers

Stick with your Validation Rule. You just need to add a clause for ISNEW. OR( AND(ISNEW(), NOT(ISNULL(UnitPrice)), ISCHANGED(UnitPrice) ) If you want to add a UserRole blacklist to the mix, ...
Adrian Larson's user avatar
  • 151k

Only top scored, non community-wiki answers of a minimum length are eligible