Zoho People - Retrieve the Leave Details - get("LeaveCount")

Zoho People - Retrieve the Leave Details - get("LeaveCount")

Hi, 
Zoho People
I need to collect all of an employee's leave requests for the calendar year and check how many half-days they have taken. 
If I run the script on the query he just modified, I can retrieve the information related to that query and use the get("LeaveCount")

LeaveReq = zoho.people.getRecordByID("P_Leave",ParamUserId);
LeaveDayDetails = LeaveReq.get("DayDetails");
for each  LeaveDay in LeaveDayDetails
{
      LeaveCount = LeaveDay.get("LeaveCount");
      if(LeaveCount = 0.5)
      {
CountHalf = CountHalf + 1;     
      }
}

But in reality, I have to read all the leave requests for the calendar year and check the details of each one.  I don't know how to Retrieve the detail for each leave.

dat = Map();
searchMap1 = Map();
searchMap1.put("searchField","Employee_ID");
searchMap1.put("searchOperator","Is");
searchMap1.put("searchText",Ee_num);
searchMap2 = Map();
searchMap2.put("searchField","From");
searchMap2.put("searchOperator","Between");
searchMap2.put("searchText",DateRange);
searchMap2.put("searchCriteria","AND");
searchMap3 = Map();
searchMap3.put("searchField","Leavetype");
searchMap3.put("searchOperator","Contains");
searchMap3.put("searchText","Annual H");
searchMap3.put("searchCriteria","AND");
////Create list to hold all the search conditions 
searchList = List();
searchList.add(searchMap1);
searchList.add(searchMap2);
searchList.add(searchMap3);
// Execute the get records task to fetch the search result 
response = zoho.people.getRecords("leave",1,20,searchList);
for each  LeaveReq in response
{
LeaveType = LeaveReq.get("Leavetype");
FromDt = LeaveReq.get("From");
ToDt = LeaveReq.get("To");
ApprStatus = LeaveReq.get("ApprovalStatus");
Daystaken = LeaveReq.get("Daystaken");
if(ApprStatus != "Cancelled" && ApprStatus != "Rejected" || LeaveType == "Annual H")
      {
// Retrieve the detail for that leave ????
      }
}


Could you please assist?
Thank you.
Veronique

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner









                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方