For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho Recruit: Rollup Number of Recruit Candidates to CRM Account

Zoho Recruit: Rollup Number of Recruit Candidates to CRM Account

What?
This is a quick article to note down some code used in Zoho Recruit. This particular bit of code will run on a workflow when a Candidate is modified, and it tallies all the candidates belonging to the same school and updates some number fields on the matched CRM account.

Why?
For reporting purposes. Although Zoho Analytics can use data imported from both ZohoCRM and ZohoRecruit, it was helpful on the CRM record to see how many candidates had been placed at this particular CRM Account. We added several fields which get populated when a candidate was modified in ZohoRecruit.

How?
As mentioned, we're going to update several fields called:
  • Number of Candidates This Graduation Year
  • Number of Candidates Next Graduation Year
  • Candidates Graduated in the Past
  • Candidates Graduating in the Future
  • Total Number of Candidates
I'll flesh this out some other time but here's the code I used:
copyraw
r_CandidateDetails = zoho.recruit.getRecordById("Candidates",p_CandidateID,"zrecruit");
//info r_CandidateDetails;
if(!isNull(r_CandidateDetails.get("Which School do you go to?")))
{
	v_SchoolName = r_CandidateDetails.get("Which School do you go to?");
	v_SchoolID = r_CandidateDetails.get("Which School do you go to?_ID");
	b_SchoolPaid = if(r_CandidateDetails.get("Paid School") == "true",true,false);
	//
	v_CandidatePlacedCount = 0;
	v_CandidateGraduatingCount = 0;
	v_CandidateGraduatingNextCount = 0;
	l_CandidateSearch = zoho.recruit.searchRecords("Candidates","School Name|=|" + v_SchoolName,1,200,"ALL","zrecruit");
	for each  r_Candidate in l_CandidateSearch
	{
		if(!isnull(r_Candidate.get("CANDIDATEID")))
		{
			v_CandidatePlacedCount = v_CandidatePlacedCount + 1;
			r_CandidateDetail = zoho.recruit.getRecordById("Candidates",r_Candidate.get("CANDIDATEID"),"zrecruit");
			if(!isnull(r_CandidateDetail.get("Graduation Year")))
			{
				v_GraduationYear = r_CandidateDetail.get("Graduation Year");
				if(v_GraduationYear == zoho.currentdate.addYear(1).getYear() && zoho.currentdate.getMonth() >= 9 || v_GraduationYear == zoho.currentdate.getYear() && zoho.currentdate.getMonth() < 9)
				{
					v_CandidateGraduatingCount = v_CandidateGraduatingCount + 1;
				}
				if(v_GraduationYear == zoho.currentdate.addYear(2).getYear() && zoho.currentdate.getMonth() >= 9 || v_GraduationYear == zoho.currentdate.addYear(1).getYear() && zoho.currentdate.getMonth() < 9)
				{
					v_CandidateGraduatingNextCount = v_CandidateGraduatingNextCount + 1;
				}
			}
		}
	}
	//
	m_Blank = Map();
	l_SchoolSearch = zoho.crm.searchRecords("Accounts","Account_Name:equals:" + v_SchoolName,1,10,m_Blank,"zcrm");
	for each  r_School in l_SchoolSearch
	{
		// check no search error and valid records are returned
		if(!isnull(r_School.get("id")))
		{
			// check this record is the same school
			if(r_School.get("Account_Name").equalsIgnoreCase(v_SchoolName))
			{
				// update the CRM record
				m_Trigger = Map();
				m_Update = Map();
				m_Update.put("Total_Number_of_Candidates",v_CandidatePlacedCount);
				m_Update.put("Number_of_Candidates_This_Graduation_Year",v_CandidateGraduatingCount);
				m_Update.put("Number_of_Candidates_Next_Graduation_Year",v_CandidateGraduatingNextCount);
				r_Update = zoho.crm.updateRecord("Accounts",r_School.get("id"),m_Update,m_Trigger,"zcrm");
				info r_Update;
			}
		}
	}
}
  1.  r_CandidateDetails = zoho.recruit.getRecordById("Candidates",p_CandidateID,"zrecruit")
  2.  //info r_CandidateDetails; 
  3.  if(!isNull(r_CandidateDetails.get("Which School do you go to?"))) 
  4.  { 
  5.      v_SchoolName = r_CandidateDetails.get("Which School do you go to?")
  6.      v_SchoolID = r_CandidateDetails.get("Which School do you go to?_ID")
  7.      b_SchoolPaid = if(r_CandidateDetails.get("Paid School") == "true",true,false)
  8.      // 
  9.      v_CandidatePlacedCount = 0
  10.      v_CandidateGraduatingCount = 0
  11.      v_CandidateGraduatingNextCount = 0
  12.      l_CandidateSearch = zoho.recruit.searchRecords("Candidates","School Name|=|" + v_SchoolName,1,200,"ALL","zrecruit")
  13.      for each  r_Candidate in l_CandidateSearch 
  14.      { 
  15.          if(!isnull(r_Candidate.get("CANDIDATEID"))) 
  16.          { 
  17.              v_CandidatePlacedCount = v_CandidatePlacedCount + 1
  18.              r_CandidateDetail = zoho.recruit.getRecordById("Candidates",r_Candidate.get("CANDIDATEID"),"zrecruit")
  19.              if(!isnull(r_CandidateDetail.get("Graduation Year"))) 
  20.              { 
  21.                  v_GraduationYear = r_CandidateDetail.get("Graduation Year")
  22.                  if(v_GraduationYear == zoho.currentdate.addYear(1).getYear() && zoho.currentdate.getMonth() >9 || v_GraduationYear == zoho.currentdate.getYear() && zoho.currentdate.getMonth() < 9) 
  23.                  { 
  24.                      v_CandidateGraduatingCount = v_CandidateGraduatingCount + 1
  25.                  } 
  26.                  if(v_GraduationYear == zoho.currentdate.addYear(2).getYear() && zoho.currentdate.getMonth() >9 || v_GraduationYear == zoho.currentdate.addYear(1).getYear() && zoho.currentdate.getMonth() < 9) 
  27.                  { 
  28.                      v_CandidateGraduatingNextCount = v_CandidateGraduatingNextCount + 1
  29.                  } 
  30.              } 
  31.          } 
  32.      } 
  33.      // 
  34.      m_Blank = Map()
  35.      l_SchoolSearch = zoho.crm.searchRecords("Accounts","Account_Name:equals:" + v_SchoolName,1,10,m_Blank,"zcrm")
  36.      for each  r_School in l_SchoolSearch 
  37.      { 
  38.          // check no search error and valid records are returned 
  39.          if(!isnull(r_School.get("id"))) 
  40.          { 
  41.              // check this record is the same school 
  42.              if(r_School.get("Account_Name").equalsIgnoreCase(v_SchoolName)) 
  43.              { 
  44.                  // update the CRM record 
  45.                  m_Trigger = Map()
  46.                  m_Update = Map()
  47.                  m_Update.put("Total_Number_of_Candidates",v_CandidatePlacedCount)
  48.                  m_Update.put("Number_of_Candidates_This_Graduation_Year",v_CandidateGraduatingCount)
  49.                  m_Update.put("Number_of_Candidates_Next_Graduation_Year",v_CandidateGraduatingNextCount)
  50.                  r_Update = zoho.crm.updateRecord("Accounts",r_School.get("id"),m_Update,m_Trigger,"zcrm")
  51.                  info r_Update; 
  52.              } 
  53.          } 
  54.      } 
  55.  } 
Category: Zoho Recruit :: Article: 355

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com