I have an issue with our PRICE BOOK ENTRY Upsert using the DataLoader batch bulk job.
We have External IDs in our PRICE BOOK and PRODUCT objects that we use when Upserting to our PRICE BOOK ENTRY object to avoid using Salesforce IDs for both objects (ie. PriceBookName and ProductCode).
I am able to Upsert successfully manually through the DataLoader interface by selecting the External ID field for the PRICE BOOK ENTRY Object and then the two for the PRICE BOOK and PRODUCT objects.
But when doing it through the batch job I get the error below which relates to the two ID fields for the PRICE BOOK and PRODUCT objects. This is for all records whether fir updating or inserting.
ERROR [PricebookEntry] client.PartnerClient processResult (PartnerClient.java:434) - Error code is: INVALID_FIELD_FOR_INSERT_UPDATE
ERROR [PricebookEntry] client.PartnerClient processResult (PartnerClient.java:435) - Error message: Unable to create/update fields: Pricebook2Id, Product2Id. Please check the security settings of this field and verify that it is read/write for your profile or permission set.
I have checked the security settings for my profile and I have read/write access to all objects and fields.
I generated the SDL file through the interface which is below.
#Mapping values
PRODUCT_EXTID=Product2\:ProductCode__c
PRICEBOOK_EXTID=Pricebook2\:PriceBookName__c
UNITPRICE=UnitPrice
PBE_EXTERNAL_ID__C=PBE_External_ID__c
ISACTIVE=IsActive
Note that if I remove the two lines relating to the error then it Upserts successfully but that is only ok for existing entries not any new ones that need to be inserted.
I read somewhere that the relationship between Product and PriceBookEntry is Master-Detail, as is between PriceBook and PriceBookEntry. So if you want to update Product2 ID or PriceBook2 ID in PricebookEntry, the above error will be received. I can see why this could be a problem but I am not updating the IDs. I am just referencing the External IDs which always exist.
I am using the System Admin user for both the DataLoader interface and batch job so the error message seems a bit odd seeing it works for the interface but not the batch bulk job.
Hoping someone can help.