Hello Team - I am loading data into the Incident table of a Dynamics 365 environment from an Azure SQL DB using the Azure Data Factory.
the Incident table has lookups to the Account table on AccountId and Contacts via the ContactId. I have populated these two tables and obtained their GUIDs using a Data Flow so the mapping is straightforward up to this point.
There is a field called CustomerId that is a polymorhpic field.
Schema Name:
CustomerId
logical name:
customerid
Account relationship name:
incident customer accounts
Contact relationship name:
incident_customer_contacts
I am not certain I have the correct code for mapping this field.
I reviewed the info at this url https://xrmdynamicscrm.wordpress.com/2020/06/25/dynamics-365-setting-multi-entity-lookup-field-while-writting-data-from-azure-data-factory/
and here https://medium.com/@mleitner9367/importing-data-with-polymorphic-lookup-fields-into-dataverse-using-azure-data-factory-adf-0a5e0779f211
but they do not appear to work.
I had created a derived field in the source table as a test where it has account(d0f6bg41-2s2e-5b67-8765-78092e0g67c) or contact(sdgsdde-5r5y-8765-73456h67y) mapped to the target tables customerid column. But this returns an error that the customerid can only have a guid value of 32 digits with 4 dashes suggesting my value is not correct. After reading some info on micrsoft at https://learn.microsoft.com/en-us/azure/data-factory/connector-dynamics-crm-office-365?tabs=data-factory#writing-data-to-a-lookup-field I changed the mappings to customerid to customerid (guid) and to have a target field with the values of account and contact mapped to the field customerid@EntityReference which appears to have gotten me a step closer as one of the errors I got was the only valid entities are account and contact eg not the plural name. Now I get an error that says "Dynamics operation failed with error code: -2147220891, error message: Cannot find record to be updated" and can't figure out where this is coming from as the GUIDs for customerid are in their respective tables and this is new data into the incident table. Any thoughts as to what would be giving me this error.