Create Relationships in CRM 3.0 programmatically
Ever have the need to programmatically create a relationship between contacts or between a contact and an account?
I stumbled on this problem when a client requested that I import relationships from the legacy ACT! 6 database.
The field where [Lead source] and [referred by].
The relationship entity schema name is "customerrelationship".
The entity has the following important attributes:
Attribute | Description |
customerroledescription/partnerroledescription | The description for the relationship |
customerid/partnerid | The Lookup for the customer and partner respectively |
customerroleid/partnerroleid | The lookup for the relationship role (This can be configured in the Settings section of CRM) |
It is that simple, create your class than call the service.create method of the CRM 3.0 to create the relationship.
Have a great day.
Oshri Cohen
Labels: API, crm 3.0, customizations crm 3.0, Webservice