I am trying to schedule a script so that cert statuses for vendors update (Expired or Approved) based on cert expiration dates recorded within the vendors module. Below is the code I have
// Supplier Profile Update
//-------------------------------
//Format today's date for comparison
formattedToday = toDateTime(today,"YYYY-MM-dd");
//Loop through all Suppliers
allSuppliers = zoho.crm.getRecords("Vendors");
for each supplier in allSuppliers
{
//Get Supplier Data
expireDate = supplier.get("Supplier_Profile_Expiration");
supplierId = supplier.get("id");
//No Date
if(expireDate.isNull() = True || expireDate = "")
{
//Stage update value for Supplier Profile
supplierProfile = {"Supplier_Profile":"NO"};
}
else
{
//Format the expiration date for comparison
formattedExpire = toDateTime(expireDate,"yyyy-MM-dd");
//info "Today: " + formattedToday;
//info "Expire: " + formattedExpire;
//Compare dates
if(formattedExpire < formattedToday)
{
//Stage update value for Supplier Profile
supplierProfile = {"Supplier_Profile":"EXPIRED"};
}
else
{
//Stage update value for Supplier Profile
supplierProfile = {"Supplier_Profile":"APPROVED"};
}
}
// Update the record
updateRecord = zoho.crm.updateRecord("Vendors",supplierId,supplierProfile);
}
The code executes fine. But when I run it it doesn't produce any results. So I noticed under the schedule in the image below, that I still need to create arguments to map it to Zoho CRM. I have no idea what this means?
The image below is the field that became available. I honestly have no idea what to do with this, or how to make it work with my script/schedule so I achieve these auto cert updates based on cert expiration dates. Any help or assistance would be greatly appreciated