Closed homerlex closed 5 years ago
The error "record type missing" is because the sObject you are inserting has record types at the destination org and you are not providing the value for that. Try modifying the ETCopyData, and adding this entry in the sObjectsMetadata field and try again.
{
"name": "RecordType",
"fieldsToExport": "Id,DeveloperName",
"matchBy": "DeveloperName"
}
That helps. Thanks!
Looking at this again, is matching by DeveloperName sufficient? Should it match by SObjectType + DeveloperName? ... and is it possible to "matchBy" multiple columns?
I did something like following to include namespace and objecttype:
"sObjectsMetadata": [
{
"name": "RecordType",
"fieldsToExport": "Id,DeveloperName,SObjectType,NamespacePrefix",
"matchBy": "NamespacePrefix,SObjectType,DeveloperName",
"orderBy": null,
"where": null
}
],
When I do an export I see that the RecordType.json looks good in both the source and destination files. The RecordTypeId is properly set in the source's Contact.json file. However, all the contact objects created in the destination are given the default record type instead of the record type that was assigned in the source.
Found and fixed the issue. I will update the source soon. The ETCopyData.json file needs to be changed to something like this:
{
"name": "RecordType",
"fieldsToExport": "Id,SobjectType,DeveloperName",
"matchBy": "SobjectType, DeveloperName",
}
The matching will be done by SobjectType and DeveloperName. This fixes 2 different problems. Same recordType's developerName used for multiple sObjects and the value not being set properly. I believe this last issue was that it was not being properly found.
I just did a simple export/import on account:
The export worked but when i went to do an import each account record errored out with something like: