I'm in the process of switching from Dynamics CRM 2011 On-Premises to Dynamics CRM 2015 Online.
I was able to migrate the custom attributes using the most recent version of the Dynamics CRM SDK (7.1), with the exception of the Virtual and Lookup attributes, which cannot be created using the Create Attribute Request method.
Now next, I need to migrate all the relationships. So far, I've been able to get the necessary OneToManyRelationshipMetadata and ManyToManyRelationshipMetadata. However, for OneToManyRelationshipMetadata I need to pass a LookupAttributeMetadata to the CreateAttributeRequest.
OneToManyRelationshipRequest request = new OneToManyRelationshipRequest()
{
Lookup = new LookupAttributeMetadata()
{
SchemaName = "new_topicid",
DisplayName = new Label("Subject", 1033),
Description = new Label("Subject Description", 1033)
},
OneToManyRelationship = new OneToManyRelationshipMetadata()
{
ReferencedEntity = "subject",
ReferencedAttribute = "subjectid",
ReferencingEntity = "customer",
ReferencingAttribute = "new_topicid"
}
}
However, I get the exception that attribute new_topicid doesn't exist. That may make sense, since I had to skip it during Attribute creation earlier (since it can't be created through CreateAttributeRequest).
Is there any other way how I can migrate the LookupAttributeMetadata or OneToManyRelationshipMetadata/ManyToManyRelationshipMetadata to Dynamics CRM online?
Here's a link that may help you.
LookupAttributeMetadata EntityType (Microsoft.Dynamics.CRM) | Microsoft Learn