-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMass_Update_of_Child_Contacts.ds
More file actions
26 lines (24 loc) · 987 Bytes
/
Copy pathMass_Update_of_Child_Contacts.ds
File metadata and controls
26 lines (24 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Author: georgeotj
// Description: Automatically updates the address of child contacts whenever the address information for the Account is updated.
// Requirements: N/A
// Arguments: accID = Account Id
// Declare variables
rec = zoho.crm.getRecordById("Accounts",accId);
resp = zoho.crm.getRelatedRecords("Contacts","Accounts",accId);
// Code
for each ele in resp
{
mp = Map();
mp.put("Mailing_Street",rec.get("Billing_Street"));
mp.put("Mailing_City",rec.get("Billing_City"));
mp.put("Mailing_State",rec.get("Billing_State"));
mp.put("Mailing_Zip",rec.get("Billing_Code"));
mp.put("Mailing_Country",rec.get("Billing_Country"));
mp.put("Other_Street",rec.get("Shipping_Street"));
mp.put("Other_City",rec.get("Shipping_City"));
mp.put("Other_State",rec.get("Shipping_State"));
mp.put("Other_Zip",rec.get("Shipping_Code"));
mp.put("Other_Country",rec.get("Shipping_Country"));
contactId = ele.get("id");
updateResp = zoho.crm.updateRecord("Contacts",ele.get("id"),mp);
}