function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AndreaRozAndreaRoz 

DataLoader and PriceBookEntry

Hi,
is it possible to customize PriceBookEntry object? if yes how?!?
I wish to create a custom field as External Id so as to use this field for automatic import process via Apex Data Loader for OpportunityLineItem.
Without a custom filed I'm not able to create a batch process for import data because in the opportunityLineitem I need:
1) OpportunityId -> I can use an external id field for automatic lookup
2) PricebookEntryId -> If I have got only standard field I can't automate the "upsert" , process ... is it right?
Thank you
--
Andrea
benjasikbenjasik
externalid requires the object to support a custom field.  I don't believe that object supports custom fields yet.
eqmeqm

It's almost 2010 now and I see this issue was raised here in June of 2007. I wonder if there's been any progress on this? I've been trying to figure out how/if it is possible to do an upsert operation on a PricebookEntry object. The API upsert docs say:

 

"This call is available for objects if the object has an external ID field or a field with the idLookup field property.

 

On custom objects, this call uses an indexed custom field called an external ID to determine whether to create a new object or update an existing object. On standard objects, this call can use the name of any field with the idLookup field property instead of the external ID."

 

Somewhere in the docs I remember reading that the Salesforce object Id field which is present on every object has this idLookup property by default, but I've looked at a bunch of objects in the APEX Explorer and I don't see any objects with a field that has this idLookup property. So, can anyone tell me definitively whether or not a PricebookEntry can be upserted via the API? It just seems really odd that a PricebookEntry wouldn't be upsertable. It's definitely update-able.

 

I have somewhere around 70,000 pricebook entries that I need to update via the API, but so far this has proved to be surprisingly difficult to do. First I was trying to do individual queries using the normal Partner API, but that used up too many API calls in testing. Then I switched to the new BulkAPI and discovered I have to break up my batches into dozens of smaller files, effectively negating much of its usefulness since I again hit the 500 batch limit in testing on our live API. I jumped through those coding hoops, then in the sandbox api most of my batches started failing due to timeouts and in the docs the only solutions to this say to break your batches into smaller files which means even more requests. I guess my point is, I'm already fighting with the API limitations constantly. Without being able to do an upsert on a PricebookEntry it makes it hard to avoid doing even more unnecessarry API calls and writing more inefficient code. So, I'm really hoping someone has already solved this prob and I just haven't found the solution yet.