Territories are a data-sharing structure that allows you to hide certain records from users based off record-level criteria. When you assign a territory to an Account, the system automatically assigns that territory to all related Contacts. However, when there is more than one territory assigned, the workflow does not repeat (eg; if an Account is assigned Territory1, Territory2 and Territory3, the related Contacts are only assinged Territory1). This script makes sure that ALL territories assigned in an Account gets assigned to ALL related Contacts by getting the territory IDs off the Account, then assigning them in Contacts via Territories API.
In order to call the Zoho CRM API within a Deluge Script, you must first create a connection to it.
Zoho OAuth Connections needed:
LIST
variable and use a LOOP
to add all the territory IDs in the list container.LOOP
to iterate through every Contacts, and another LOOP
inside it to iterate through every ID in the territory ID list. Here, another API call is used to assign the territories to the Contacts.Note: +”” is added after paramap to convert it to string for the function to work
Click here to copy these 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....