Skip to content

Instantly share code, notes, and snippets.

@CubeYogi
Last active November 16, 2020 11:31
Show Gist options
  • Save CubeYogi/7ca8b46f7e74e49c393935dc6a11cfd6 to your computer and use it in GitHub Desktop.
Save CubeYogi/7ca8b46f7e74e49c393935dc6a11cfd6 to your computer and use it in GitHub Desktop.
//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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment