[SalesForce] Deleting PriceBookEntry results in errors

I'm trying to use the Data Loader to delete PriceBookEntry records. However, I end up getting an error for all of them. The weird thing is that the Error message is the same as the contents of the Name field of the records.

I know Salesforce says that PriceBookEntry cannot be deleted (see the isActive field description), but the option is certainly there in Data Loader. Moreover, the error message is very odd and I was wondering how I should proceed. Any advice on this would be appreciated.

Best Answer

Pricebookentries (PBE) can definitely be deleted by DataLoader or Excel Connector - I do it all the time.

If you try and delete the pricebookEntry on the standard pricebook when there are custom pricebooks using that same product (and hence custom PBE), you will get the error 'Delete Failed' with a reference to the product name. If you first delete PBE from the custom pricebook, then no error.

I can't speak for the documentation and would say it is wrong (or needs more elaboration). You can see at the bottom of the page, the following sentence:

If you delete a PricebookEntry while a line item references it, the line item is unaffected, but the PricebookEntry will be archived and unavailable from the API.

In addition, the object supports the delete() API operation.

Related Topic