Am I using isNull() correctly in this function for a custom module called Listings? I can't get it to work. The only argument is listing_id. The function is supposed to execute when a Listing is created or updated.
// listing fields
listing_record = zoho.crm.getRecordById("Listings",listing_id);
listing_street_name = listing_record.get("Street_Name");
listing_street_number = listing_record.get("Street_Number");
listing_temp_street_address = listing_record.get("Temp_Street_Address");
listing_street_direction = listing_record.get("Dir");
listing_street_type = listing_record.get("Street_Type");
listing_mls_number = listing_record.get("MLS_Number");
listing_list_date = listing_record.get("List_Date");
// function
listing_map = Map();
if(listing_street_number.isNull())
{
street_address = listing_temp_street_address.proper();
}
else
{
street_address = listing_street_number + if(listing_street_direction.isNull(),""," " + listing_street_direction) + if(listing_street_name.isNull(),""," " + listing_street_name.proper()) + if(listing_street_type.isNull(),""," " + listing_street_type.proper());
}
// name listing
listing_name = street_address + " - " + if(listing_mls_number.isNull(),if(listing_list_date.isNull(),""," " + listing_list_date)," " + listing_mls_number);
listing_map.put("Name",listing_name);
listing_map.put("Temp_Street_Address",street_address);
listing_map.put("Street_Name",street_address);
// update listing
update_response = zoho.crm.updateRecord("Listings",listing_id.toLong(),listing_map);
info listing_map;
info update_response;