Need to mass update thousands of Lead records in Zoho CRM and can't be bothered manually clicking through tens of pages and doing mass update? Here's an example of using a custom function to achieve this. In this case, I needed to merge several notes fields into one text area field as the multiple note fields were becoming unwieldy.
Recently I was working on a custom function for Zoho CRM which required me to get the current time in a specified timezone. I assumed that zoho.currenttime would give me the time based on the timezone chosen in the organisation settings but discovered that it always gives it to you in PST. The Zoho Partner team gave me this snippet to solve the problem: current_time_in_timezone = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ss", "Australia/Sydney").toTime("yyyy-MM-dd'T'HH:mm:ss"); If you need the current date, do: current_date_in_timezone = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ss", timezone).toDate(); To figure out what you can put in for the timezone part, refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Hey Jeremy
ReplyDeleteI use a recursion function for getting a lot of records. I don't have to use an iterator, the function itself will determine if it has to take another round. Maybe it helps you or someone else.
list space.getRecords(string customViewName, int start)
{
blocksize = 200;
end = (input.start + blocksize - 1);
allRecords = List();
foundRecords = zoho.crm.getRecords(input.customViewName, input.start, end);
if (foundRecords.size() > 0)
{
allRecords.addall(foundRecords);
if (foundRecords.size() == blocksize)
{
followingRecords = thisapp.space.getRecords(input.customViewName, (end + 1));
allRecords.addall(followingRecords);
}
}
return allRecords;
}
Although this example uses a custom view one could also use searchRecords() with a search criteria.
You call it with completeList = thisapp.space.getRecords(, 1).
Best,
Sascha
Nice one Sascha. Recursion is another interesting way to solve this.
ReplyDelete