You are on page 1of 1

services = zoho.crm.

getRecordById("Services",id);
purchasedate = services.get("Date_Of_Purchase").toDateTime();
//Warranty_Expiry = services.get("Warranty_Expiry").toDateTime();
Warranty_in_months = services.get("Warranty_in_months");
Warranty_Expiry_Date = addMonth(purchasedate,Warranty_in_months);
Warranty_Expiry_Date = Warranty_Expiry_Date.toDate();
info Warranty_Expiry_Date;
upd = zoho.crm.updateRecord("Services",id,
{"Warranty_Expiry":Warranty_Expiry_Date});
current = today;
info current;
days = daysBetween(Warranty_Expiry_Date,current);
info days;
if ( days <= 0 )
{
upd = zoho.crm.updateRecord("Services", id, {"Type_of_Service":"Under
Warranty"});
}
else
{
upd = zoho.crm.updateRecord("Services", id, {"Type_of_Service":"Out of
Warranty"});
}

You might also like