This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |