You need to sign in to do that
Don't have an account?
JBabu
"FIELD_INTEGRITY_EXCEPTION, Price Book Entry ID: id value of incorrect type
Hi,
Even though id values are same for pricebook2 id of opportunity and pricebookentry id for opportunity line item. I have verified both the ids by putting debug statements also.
Even I checked the status they are active as I am explicitly inserting isActive=true for test data records.
It is strange to know I a getting the below issue:
"FIELD_INTEGRITY_EXCEPTION, Price Book Entry ID: id value of incorrect type".
Can some one please help on this issue?
Thanks,
JBabu.
JBabu,
The exception says that your price book entry (PriceBookEntry object) id is invalid. Make sure you're not passing price book (Pricebook2 object) id as a price book entry id.
PriceBookEntry ID prefix is 01u - make sure your id starts with 01u
Pricebook2 ID prefix is 01s
JBabu,
When you are creating Opportunity Line Item set price of Line Item = PricebookEntry.UnitPrice.
This will remove the exception.
Thanks
Imran
You can use below SOQL to get the PricebookEntryId
For more specific results, use Pricebook2Id, Product2Id in where condition on above SOQL query.