This is my function. Essentially I want to get 2 date fields from a Deal record and populate a third field with the datesBetween value.
enqcall = zoho.crm.getRecordById("Deals",id.toString());
tourStartDate = enqcall.get("Start_Date");
info tourStartDate;
tourEndDate = enqcall.get("Tour_End_Date");
info tourEndDate;
if(tourStartDate && tourEndDate is not null)
{
startDate_date = tourStartDate.toDate();
endDate_date = tourEndDate.toDate();
tripLength = daysBetween(tourStartDate,tourEndDate) + 1;
info "tripLength: " + tripLength;
query_Map = Map();
query_Map.put("Trip_Length",tripLength);
updateenq = zoho.crm.updateRecord("Deals",id.toString(),query_Map);
info "update: " + updateenq;
}