1

I'm getting the following error when running dataloader (inserting new quotelineitems), however an identifcal anonymous apex works fine - any thoughts?

Error: The price book entry is in a different price book than the one assigned to the Quote, or Quote has no price book assigned.: Price Book Entry ID

I tried including/excluding Product2Id - but the error is the same either way.

enter image description here

1

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 Product2Id is populated with PricebookEntryId data, you receive an error message. In API 39.0 and later, Product2Id is made null, and PricebookEntryId is populated with the PricebookEntryId data.

I suspect you don't want to be setting the Product2Id via DataLoader as it will try and put it in the standard pricebook, which will likely conflict with the pricebook on the quote. Or something like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.