Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Error creating line item: field integrity exception: PricebookEntryId (pricebook entry not in opportunity pricebook)
Here is the code I am using
sForce.OpportunityLineItem oli = new sForce.OpportunityLineItem();
oli.Description = sDesc[x];
oli.OpportunityId = oppId;
oli.PricebookEntryId = "01u30000000QXMzAAO";
oli.Quantity = double.Parse(sQuantities[x]);
oli.QuantitySpecified = true;
oli.UnitPrice =double.Parse(sUnitPrice[x]);
oli.UnitPriceSpecified = true;
sForce.SaveResult sr = binding.create(new sForce.sObject[] {oli})[0];