1
votes

Does Bulk API Upsert support custom objects in polymporphic fields? It does support polymorphic fields (e.g. Event.What) and custom objects - but when I try to upsert an event with a custom object in What I get an error.

Here is the csv file uploaded (to upsert an event):

"Invoice__c:What.ExtId__c","Subject","OwnerId","Type__c","ExtId__c"
"INV_686850","xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","00558000001bxXX","EMail","EVT_10022339"

and here is the error message:

Failed InvalidBatch : Entity type for the polymorphic foreign key reference: What didn't match the supplied type: Invoice__c

"Track Activities" is enabled for Invoice__c - and looking into workbench the relationship between Event and Invoice__c is visible on both sides of the relationship. It is also possible to add an event to an Invoice__c in the UI.

1

1 Answers

1
votes

For your header value "Invoice__c:What.ExtId__c", remove the __c for the Entity Type. "Invoice:What.ExtId__c".

Even though its a custom entity, the bulk api does not want the __c suffix. This is not documented anywhere I could find.