Schedule 200 calls for contacts with a Button based on the view that the button is in
Hi Everyone
Hopep you are well.
I need some help nailing this code down.
I need to create a butotn that generates 200 calls for contacts. The button will be placed in the contacts module and will need to generate the calls for the contacts based on the custom view that it is currently in.
Below is the code I am using the to schedule the calls, I am battling to figure out how to point it to the view it is currently in
- contactList = zoho.crm.getRecords("Contacts",1,1,{"cvid":"6101631000000087529"});
- for each contact in contactList
- {
- mp = Map();
- contactDetails = zoho.crm.getRecordById("Contacts",contactId);
- acctname = ifnull(contactDetails.get("Account_Name"),"");
- if(acctname != "")
- {
- acctid = acctname.get("id");
- accountDetails = zoho.crm.getRecordById("Accounts",acctid);
- mp.put("$se_module","Accounts");
- mp.put("What_Id",acctid);
- }
- mp.put("Subject","compcallpurpose");
- mp.put("Call_Purpose","compcallpurpose");
- mp.put("Owner",zoho.loginuserid);
- mp.put("Call_Type","Outbound");
- mp.put("Who_Id",contactId);
- mp.put("Call_Start_Time",today);
- // mp.put("$which_call","ScheduleCall");
- create = zoho.crm.createRecord("Calls",mp);
- }
- return "";