For Zoho Services only:


I'm actually part of something bigger at Ascent Business Solutions recognized as the top Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions offer support for smaller technical fixes and projects for larger developments, such as migrating to a ZohoCRM.  A team rather than a one-man-band is always available to ensure seamless progress and address any concerns. You'll find our competitive support rates with flexible, no-expiration bundles at http://ascentbusiness.co.uk/zoho-support-2.  For larger projects, check our bespoke pricing structure and receive dedicated support from our hands-on project consultants and developers at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices.

The team I manage specializes in coding API integrations between Zoho and third-party finance/commerce suites such as Xero, Shopify, WooCommerce, and eBay; to name but a few.  Our passion lies in creating innovative solutions where others have fallen short as well as working with new businesses, new sectors, and new ideas.  Our success is measured by the growth and ROI we deliver for clients, such as transforming a garden shed hobby into a 250k monthly turnover operation or generating a +60% return in just three days after launch through online payments and a streamlined e-commerce solution, replacing a paper-based system.

If you're looking for a partner who can help you drive growth and success, we'd love to work with you.  You can reach out to us on 0121 392 8140 (UK) or info@ascentbusiness.co.uk.  You can also visit our website at http://ascentbusiness.co.uk.

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 :: Article: 823

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

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

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
© 2024 Joel Lipman .com. All Rights Reserved.