Skip to content

Instantly share code, notes, and snippets.

//Validating contact ID
if(input.contact_id != null)
{
//Getting contact entry
contact_entry = zoho.crm.getRecordById("Contacts",contact_id);
//Validating contact entry
if(!contact_entry.isEmpty())
{
contact_map = Map();
//Getting contact value
//Validating Task ID
if(input.task_id != null)
{
//Getting task entry
task_entry = zoho.crm.getRecordById("Tasks",task_id);
//Validating Task entry
if(!task_entry.isEmpty())
{
task_map = Map();
//Getting task subject
//Getting Contact form entries
//Replace your form and fields link name if needed
for each contact in Contact_Form[date_of_birth != null]
{
//Calculating Age
from_year = contact.date_of_birth.getYear();
to_year = zoho.currenttime.getYear();
age_calculated = to_year - from_year;
//Updating age
contact.age = age_calculated;
//Getting employee form entries
//Replace your form and field link name if needed
for each employee in Employee[dateofhire != null]
{
//Calculating Years of Service
from_year = employee.dateofhire.getYear();
to_year = zoho.currenttime.getYear();
service_year = to_year - from_year;
//Updating Years of Service
employee.yearsofservice = service_year;
//Validating Ticket ID
if(ticket_id != null )
{
//Getting Ticket entry
//Replace your Organization ID for 'xxx'
ticket_entry = zoho.desk.getRecordById(xxx,"tickets",ticket_id);
//Validating Ticket entry
if(!ticket_entry.isEmpty())
{
//Getting Account ID
//Validating Account ID
if(account_id != null && account_id.trim() != "")
{
//Getting Account entry
account_entry = zoho.crm.getRecordById("Accounts", account_id);
//Validating Account response
if(!account_entry.isEmpty())
{
//Getting Account value
//Replace your Accounts field API name here if needed
//Validating Account ID
if(account_id != null && account_id.trim() != "")
{
//Getting Account entry
account_entry = zoho.crm.getRecordById("Accounts", account_id);
//Validating Account response
if(!account_entry.isEmpty())
{
//Getting Account value
//Replace your Accounts field API name here if needed
//Validating Name
if(input.Name != null && input.Name.trim() != "")
{
//Redirecting Form with name autofilled
//Replace field names with your form's link names if needed
openUrl("#Form:Scheduling?Name="+input.Name,"same_window");
}
else
{
info "Registration Name is empty";
//Validating Billing Email
if(billing_email != null && billing_email.trim() != "")
{
//Validating account ID
if(account_id != null)
{
//Putting billing_email in the update map
update_map = Map();
update_map.put("Billing_Email", billing_email);
//Updating Account Entry
void testing_books_api()
{
//Getting records in Contacts module
//Replace your Books Org ID with xxx
contact_entries = zoho.books.getRecords("Contacts", "xxx");
info contact_entries;
}