-
Notifications
You must be signed in to change notification settings - Fork 0
/
bulk-upgrade-form-url-in-crm
37 lines (34 loc) · 1.15 KB
/
bulk-upgrade-form-url-in-crm
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
27
28
29
30
31
32
33
34
35
36
37
records = zoho.crm.getRecords("FP_Projects",0,200,{"cvid":"1915689000054091041"});
upd_list = List();
for each item in records
{
item_list = List();
item_map = {
"Site_Name3" : item.get("Site_Name3"),
"w_s_s" : item.get("Work_Summary_Sale"),
"proj_sow" : item.get("Scope_of_Work_URL"),
"id" : item.get("id"),
"Name" : item.get("Name"),
"Job_Number" : item.get("Job_Number"),
"Client_name" : item.get("Account_name"),
"client_contact_name" : item.get("Client_name"),
"Client_phone" : item.get("Client_phone"),
"Site_address" : item.get("Site_address"),
"hide_from_contractor": true
};
client_completion_certificate_url = "https://zfrmz.com/rXcdk2qZIMDkvbSIjobT/?";
for each thing in item_map.keys(){
client_completion_certificate_url = client_completion_certificate_url + "&"+thing+"="+zoho.encryption.urlEncode(item_map.get(thing));
}
upd_list.add({"id":item.get("id"), "Completion_Certificate_URL_Client" : client_completion_certificate_url});
if(upd_list.size() == 100)
{
info zoho.crm.bulkUpdate("FP_Projects",upd_list);
upd_list = List();
}
}
if(upd_list.size() > 0)
{
info zoho.crm.bulkUpdate("FP_Projects",upd_list);
}
return "";