In the Zoho CRM Module I have TRN Field I should contain 15 digit Number , If it Contain less than 15 digit Then show Alert message on save of the button , If it not contain any number not want to sh

In the Zoho CRM Module I have TRN Field I should contain 15 digit Number , If it Contain less than 15 digit Then show Alert message on save of the button , If it not contain any number not want to sh

Hi
In the Zoho CRM Module I have TRN Field I should contain 15 digit Number , If it Contain less  than 15 digit Then show Alert message on save of the button , If it not contain any number not want to show alert.
How We can achive in Zoho CRm Using custom Function.

Below is the Custom function i tried , If it Not contain value it showing alert message on save

map validation_rule.TRN_Validation1(String crmAPIRequest)

{
response = Map();
entityMap = crmAPIRequest.toMap().get("record");
record_id = entityMap.get("id");
info record_id;
// get_record_details = zoho.crm.getRecordById("MOM","6097715000010714090");
// Res_TRN = get_record_details.get("TRN_Number");
Res_TRN = entityMap.get("TRN_Number");
if(Res_TRN != null)
{
info "TRN NOT EMPTY";
if(Res_TRN.toString().length() != 15)
{
response.put('status','error');
response.put('message','Invalid Reference Number');
}
else
{
response.put('status','success');
}
}
else
{
info "TRN EMPTY";
response.put('status','success');
response.put("message","Condition Satisfied");
}
return response;
}

how to Fix , Pls help