Zoho Deluge Useful Codes - 1
Disable Fields in a Form
disable Unique_ID;
//disable Please_select_relevant_expertise;
//disable Please_specify_the_thematic_area_within_social_sector_that_you_specialize_in;
Assign Evaluators>Created or Edited>Successful form submission>Update Evaluators L1 in Hiring
fet = Hiring[ID == input.Unique_ID];
fet2 = Evaluators_L1_List[ID == input.Evaluator_L1];
//info fet2.Name;
fet.Evaluator_L1=fet2.Name.first_name + " " + fet2.Name.last_name;
fet.Evaluator_L1_Email_ID=fet2.Email;
openUrl("https://creatorapp.zoho.com/better_world_initiative/hiring/#Report:Assign_L1_Evaluators","same window");
BWI Hiring Application>Created or Edited>User input of 14. Do you have experience in social sector?>Experience in Social Sector 2
if(input.Do_you_have_experience_in_social_sector == "Yes")
{
show Please_select_relevant_expertise;
show Please_specify_the_thematic_area_within_social_sector_that_you_specialize_in_For_ex_Health_Educati;
}
else if(input.Do_you_have_experience_in_social_sector == "No")
{
hide Please_select_relevant_expertise;
hide Please_specify_the_thematic_area_within_social_sector_that_you_specialize_in_For_ex_Health_Educati;
}
BWI Hiring Application>Created or EditedValidations on form submission>Experience in Social Sector 3
if(input.Do_you_have_experience_in_social_sector == "Yes")
{
if(input.Please_select_relevant_expertise.isBlank() && input.Please_specify_the_thematic_area_within_social_sector_that_you_specialize_in_For_ex_Health_Educati.isNull())
{
alert "Please do not leave questions 14.1 & 14.2 blank.";
cancel submit;
}
else if(input.Please_select_relevant_expertise.isBlank())
{
alert "Please do not leave question 14.1 blank.";
cancel submit;
}
else if(input.Please_specify_the_thematic_area_within_social_sector_that_you_specialize_in_For_ex_Health_Educati.isNull())
{
alert "Please do not leave question 14.2 blank.";
cancel submit;
}
}
BWI Hiring Application>Created or Edited>Validations on form submission>File Type Should be PDF
BWI Hiring Application>Created or Edited>Successful form submission>Send Email on Form Submission
Evaluators Level 1>Created or Edited>Successful form submission>Update Status in Hiring Report
fet = input.Please_attach_your_CV;
if(!endsWithIgnoreCase(fet,".pdf"))
{
alert "Please upload your CV/Resume in PDF format only.";
cancel submit;
}
BWI Hiring Application>Created or Edited>Successful form submission>Send Email on Form Submission
Attach = Upload_Files[ID != 0].Please_upload_a_file;
sendmail
[
from :zoho.adminuserid
to :input.Please_provide_your_email_id
subject :"BWI Hiring Application"
message :("<p>Dear " + input.Please_provide_your_full_name) + ",<br/><br/>" + "Thank you for taking the time to fill out the form. We appreciate your interest in Better World Initiative program (BWI).<br/><br/>" + "Please find attached a brief document about the program and click on below link to read more about the program.<br/><br/>" + "<a href=\"https://www.genpact.com/purpose/better-world-initiative\">Better World Initiative Program</a><br/><br/>" + "Our team will review the submission and will connect, basis the fitment.<br/><br/>" + "If you have any questions, feel free to send us an email at <b>better.world@genpact.com</b>.<br/><br/>" + "<b>Regards,</b><br/>" + "<b>BWI team</b></p>"
Attachments :file:Attach
]
Evaluators Level 1>Created or Edited>Successful form submission>Update Status in Hiring Report
fet = Hiring[ID == input.Unique_ID];
//info fet.Please_provide_your_full_name;
fet.Strength=input.Strength;
fet.Weekness=input.Weekness;
fet.Feedback=input.Feedback;
fet.Shortlisted__Yes_No__Evaluator_Level_1=input.Shortlisted_Yes_No;
openUrl("https://betterworldinitiativehiring.zohocreatorportal.com/#Report:Evaluator_Report","same window");
Select Dates>Created or Edited>Load of the form>Set Dates
input.Start_Date = zoho.currentdate.subDay(1);
//input.End_Date = zoho.currentdate.addDay(1);
Select Dates>Created or Edited>Validations on form submission>End Date Greater Than or Equal to Start Date
if(input.End_Date < input.Start_Date)
{
alert "End Date (" + input.End_Date + "), cannot be before the Start Date(" + input.Start_Date + ")";
cancel submit;
}
Shortlist Candidate>Created or Edited>Successful form submission>Update Status in Shortlisted Field
fet = Hiring[ID == input.Unique_ID];
//info fet.Please_provide_your_full_name;
fet.Shortlisted=input.Shortlist_Candidate;
openUrl("https://betterworldinitiativehiring.zohocreatorportal.com/#Hiring","same window");
Test>Created or Edited>Load of the form>Show Image
Test>Created or Edited>Load of the form>Show Image
imgURL = "https://website-files.genpact.com/redesign/images/genpact-better-world-v2.jpg";
input.plain = "<img src=\"" + imgURL + "\"style=\"width:150px;height;100px;\"></img>";
BWI Hiring Application>In Hiring Report>On click of action item>Download File
if(!input.Please_attach_your_CV.isEmpty())
{
dFileName = input.Please_attach_your_CV;
//info dFileName;
dFileId = input.ID;
//info dFileId;
//dFileLink = "https://creatorapp.zoho.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
dFileLink = "https://betterworldinitiativehiring.zohocreatorportal.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
//dFileLink="https://creatorapp.zoho.com/better_world_initiative/hiring/report/Hiring_Report/4411381000002861007/Please_attach_your_CV/download-file?filepath=/1703749821030_Yash_Kohli_Resume.pdf&mediaType=3";
//info dFileLink;
//openUrl(dFileLink,"_blank");
openUrl(dFileLink,"popup window");
//openUrl("#Script:page.close","popup window");
}
if(!input.File_upload.isEmpty())
{
dFileName2 = input.File_upload;
//info dFileName;
dFileId2 = input.ID;
//info dFileId;
//dFileLink = "https://creatorapp.zoho.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
dFileLink2 = "https://betterworldinitiativehiring.zohocreatorportal.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId2 + "/File_upload/download-file?filepath=/" + dFileName2 + "&mediaType=3";
//dFileLink="https://creatorapp.zoho.com/better_world_initiative/hiring/report/Hiring_Report/4411381000002861007/Please_attach_your_CV/download-file?filepath=/1703749821030_Yash_Kohli_Resume.pdf&mediaType=3";
//info dFileLink;
//openUrl(dFileLink,"_blank");
openUrl(dFileLink2,"popup window");
//openUrl("#Script:page.close","popup window");
}
//Please_attach_Test
BWI Hiring Application>In Hiring Report>On click of action item>Download
Download multiple files at once
if(!input.Please_attach_your_CV.isEmpty())
{
dFileName = input.Please_attach_your_CV;
//-info dFileName;
dFileId = input.ID;
//-info dFileId;
//dFileLink = "https://creatorapp.zoho.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
dFileLink = "https://betterworldinitiativehiring.zohocreatorportal.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
//-info dFileLink;
openUrl(dFileLink,"popup window");
//openUrl(dFileLink,"popup window");
//openUrl("#Script:page.close","popup window");
}
BWI Hiring Application>In Hiring Report>On click of action item>Select Dates
BWI Hiring Application>In Hiring Report>On click of action item>Select Dates
MaxTime = Select_Dates[ID != 0].maximum(Added_Time);
records = Select_Dates[ID != 0];
for each rec in records
{
if(rec.Added_Time == MaxTime)
{
sDate = rec.Start_Date;
eDate = rec.End_Date;
break;
}
}
if(input.Added_Time >= sDate && input.Added_Time <= eDate)
{
if(!input.Please_attach_your_CV.isEmpty())
{
dFileName = input.Please_attach_your_CV;
//-info dFileName;
dFileId = input.ID;
//-info dFileId;
//dFileLink = "https://creatorapp.zoho.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
dFileLink = "https://betterworldinitiativehiring.zohocreatorportal.com/better_world_initiative/hiring/report/Hiring_Report/" + dFileId + "/Please_attach_your_CV/download-file?filepath=/" + dFileName + "&mediaType=3";
//-info dFileLink;
openUrl(dFileLink,"popup window");
//openUrl(dFileLink,"popup window");
//openUrl("#Script:page.close","popup window");
}
}
Comments
Post a Comment