For Zoho Services only:


I'm actually part of a bigger team at Ascent Business Solutions where we have support technicians and project consultants. Support is for smaller technical fixes but this can include developments, reports or integrations; depending on the size of the task. Projects are for more time-consuming developments such as revamps of the Zoho Suite of apps or on-site training. The advantage of a team is that if I am out-of-office for a day or so, there is always someone at Ascent Business Solutions who can deal with any queries/issues you may have.

Our support rates can be found and purchased at http://ascentbusiness.co.uk/zoho-support-2. A support bundle doesn't have an expiry date. So whether we can do what you want within the bundle and a year later need further support, if there are minutes left on the bundle then there is no additional charge.

Our project rates for bigger developments can be found at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices and will involve a dedicated project consultant along with developers who will hold your hand through the development process.

If you want help building a solution for one of the Zoho Apps in the Zoho Suite, contact us on 0121 392 8140 (UK) or by email at info@ascentbusiness.co.uk. You can also visit our website at http://ascentbusiness.co.uk.

I regularly build and specialize in 2-way API integrations for Xero, Shopify and eBay.

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: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used 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 - Valid till 8 May 2022 bc1qjtp4l4ra452wzvuk9a45yfj82zkahsyy2z379y
© 2022 Joel Lipman .com. All Rights Reserved.