I thought it is because it's trying to work with a null record, so I've put this line within conditional logic that only runs if the record returned is not null. Full code is below.
I can't figure out what I'm doing wrong. Any help would be appreciated.
crmContactSearchString = "(Login Email|=|" + input.Email + ")";
crmContact = zoho.crm.searchrecords("Contacts",crmContactSearchString);
crmLoaded = ifnull(crmContact,0);
if(crmLoaded != 0)
{
crmContactMap = crmContact.get(0);
login_status = crmContactMap.get("Login Status");
login_email = crmContactMap.get("Login Email");
if(login_email == null)
{
alert "Login account does not exist";
}
else if(login_status != "Active")
{
alert "Login account is not active";
}
}
else
{
alert "No such login account";
}