You need to sign in to do that
Don't have an account?
PriceBook problem
Hi,
I have a problem regarding saving the quotelineitem. I have entered a product and also an unitprice hardcoded in the apex code and make UseStandardPrice=true. Then entered a pricebook name as well. The product is saved but the problem came in saving quotelineitem. I have assigned product2id and pricebook2id in the pricebookentry object. I have also assigned pricibookentryid and quoteid in quotelineitem object,but while saving an error is displaying. the error is like this
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, The pricebook entry is in a different pricebook than the one assigned to the Quote, or Quote has no pricebook assigned.: [PricebookEntryId]
Please help me out in this problem.
Thanks,
Souvik
Set the Pricebook2Id on the Quote to the PriceBookId which you are using in your PriceBookEntries and referring in your QuoteLineItems.
The PriceBook needs to be set on the Quote (as also Opportunity) before using in Quote Line Items, I believe !
Do you have other products on the quote using another pricebook, all products for a quote must reside in the same pricebook.
Thanks for replying. Yes I have set same pricebook2Id on the quote which I have set in pricebookentry object..But same error remains.
Two other thinks to try: