The “Linking Module”
Here are some cool ideas on ways you can use the code in Zoho CRM:To understand how this is done is to first understand the relationship between lookup modules. When a multi-select lookup is made between two modules (eg; Contacts & Deals), a Linking Module (Contacts_X_Deals) is created. This linking module stores information of both Contacts & Deals, allowing a many-to-many relationship to be established.
Finding the Linking Module
Here are some cool ideas on ways you can use the code in Zoho CRM:To understand how this is done is to first understand the relationship between lookup modules. When a multi-select lookup is made between two modules (eg; Contacts & Deals), a Linking Module (Contacts_X_Deals) is created. This linking module stores information of both Contacts & Deals, allowing a many-to-many relationship to be established.
The linking module, unlike regular modules in CRM, is not visible from the front-end. The way to find it is to run an API call that gets ALL modules in CRM. This function reveals all modules in CRM (including hidden ones) and its respective fields.
CRM Connections needed for API Call:
- scope=ZohoCRM.settings.all (or)/li>
- scope=ZohoCRM.settings.modules.{operation_type}
response = invokeurl
[
url: "https://www.zohoapis.com/crm/v2/settings/modules"
type: GET
connection: "INSERT YOUR CONNECTION NAME HERE"
];
info response;
API Name Checklist (save for later)
- Linking Module Name
- Lookup field name to Module A
- Lookup field name to Module B
Updating the Multi-Select/User Lookup Field
Now that you have what you need, in order to update the lookup field, you need to create a record in the linking module with the relevant record IDs from Module A & B placed in its respective lookup fields.This is done by creating a map of to store the lookup fields and record IDs, which will be used to create the record in the linking module.
mp = Map();
mp.put("lookupfield_A", "A_record_ID");
mp.put("lookupfield_B", "B_record_ID");
create = zoho.crm.createRecord("Linking_Module_Name",mp);
- Replace “lookupfield_A” with the lookup field name to module A (eg; Contacts) and “A_record_ID” with the relevant record ID
- Replace “lookupfield_B” with the lookup field name to module B (eg; Deals) and “B_record_ID” with the relevant record ID
- Replace “Linking_Module_Name” with the linking module API name (they usually look like this: Contacts_X_Deals).
Contact Us!
Book a free 30-minutes consultation with a Zoho expert or send us an email
