LinkRelatedRecords
Creates a relationship between two records from different modules, such as linking a contact to a deal.
Procedure-Specific Information
ZohoCRM supports updating the relations for some specific modules and for adding the relation it requires ModuleName, Related ModuleName, RecordId of the module and RecordId of the related module.
ZohoCRM Requires atleast one related object in the request body to perform this operation and it can be added using the RelatedRecordsAggregate parameter.
For Example:
INSERT INTO LinkRelatedrecords#TEMP(RelatedRecordId#1,MemberStatus#1,RelatedRecordId#2,MemberStatus#2) values('4482327000000271429','Active','4482327000000271430','');
INSERT INTO LinkRelatedrecords#TEMP(RelatedRecordId#3) values('4482327000000271431');
EXEC LinkRelatedrecords Module = 'Campaigns', RecordId = '4482327000000467001', RelatedModule = 'Leads', RelatedRecordsAggregate = 'LinkRelatedrecords#TEMP';
You can also supply record identifiers and member statuses directly as a JSON aggregate to the RelatedRecordsAggregate parameter.
EXEC LinkRelatedrecords Module = 'Campaigns', RecordId = '4482327000000467001', RelatedModule = 'Leads', RelatedRecordsAggregate = '[{\"id\": \"984075000000575003\", \"Member_Status\": \"Active\"}, {\"id\": \"984075000000574037\", \"Member_Status\": \"Active\"}]';
Input
| Name | Type | Description |
| Module | String | Name of the primary module where the relationship is created. |
| RelatedModule | String | Name of the related module to be linked to the primary record. |
| RecordId | String | Unique identifier of the record in the primary module. |
| RelatedRecordsAggregate | String | Array of related records and their corresponding statuses to be linked in a batch operation. |
Result Set Columns
| Name | Type | Description |
| Status | String | Indicates whether the operation was successful. |
| RelatedRecordId | String | The identifier of the record which was added as a relation. |
| Message | String | The message from the Zoho CRM API indicating if the record was added as a relation. |