Null Error on code that Zoho created

Null Error on code that Zoho created

A code created by the Zoho team. Seemed to work at first, but today I noticed it hasn't worked the past couple of days and it now gives me a "ERROR AT NULL" message when I save..


  1. leadIdStr = input.leadId.toString();
  2. leadDetails = zoho.crm.getRecordById("Leads", input.leadId);
  3. info leadDetails;
  4. createdtime = ifnull(leadDetails.get("Created Time"),"");
  5. createdhour=createdtime.toString("dd-MM-yyyy HH:mm:ss").toTime().getHour();
  6. info createdhour;
  7. if ((createdhour >= 17 ) && (createdhour < 22 ))
  8. {
  9. mp=map();
  10. mp.put("SMOWNERID","1801781000000113053");
  11. update=zoho.crm.updateRecord("Leads", leadIdStr, mp);
  12. info mp;
  13. info update;
  14. }