Every Joe and Jane knows how to update lookup fields via Deluge. But when it comes to updating multi-select/user lookup fields, it can be tad bit more complicated than just sticking the “id” to the lookup field.
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:
Once executed, you will be greeted with a long JSON text containing every single module details in your CRM account. Stick the text in to a JSON viewer and quickly sieve through the modules to find the Linking Module you need (tip: they usually look like “Module_A_X_Module_B”).
Once you’ve found the module, you should see two lookup fields that links two modules (A & B) respectively. Save the module name and lookup field API names into your notes, you will need it for later.
API Name Checklist (save for later)
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.
Click here to copy the scripts. For more Zoho-wizardry, check out our GitHub page.
When scripting, ask yourself this question – will this value ever be null? If it’s a yes, that’s a place for a null check! Here are 3 tips and best practices to help you kickstart the habit....
Learn to create a customized inventory report with Zoho Analytics. This tutorial contains a link to our GitHub page for SQL code that will help with your table creations....
How nice would it be if you could, at the press of a button, send clients an email w/a Zoho Books invoice? Replete with “Pay Now” buttons that link to PayPal/Stripe/other payment gateways?...
Whether you work primarily out of CRM or the Zoho Finance Suite, you can use Analytics to build commissions dashboards. This involves some fairly simple SQL code....
If you are an inventory manager, this blog post could change your life. If you are not, it will at least teach you how to build some wicked inventory tracking for your business....
Convert fields, related activities, attachments, notes and more from one record to another across modules via custom function....
Comments