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

    Access your files securely from anywhere









                          Zoho Developer Community




                                                • Desk Community Learning Series


                                                • Digest


                                                • Functions


                                                • Meetups


                                                • Kbase


                                                • Resources


                                                • Glossary


                                                • Desk Marketplace


                                                • MVP Corner


                                                • Word of the Day


                                                • Ask the Experts





                                                          Manage your brands on social media



                                                                Zoho TeamInbox Resources



                                                                    Zoho CRM Plus Resources

                                                                      Zoho Books Resources


                                                                        Zoho Subscriptions Resources

                                                                          Zoho Projects Resources


                                                                            Zoho Sprints Resources


                                                                              Qntrl Resources


                                                                                Zoho Creator Resources



                                                                                    Zoho CRM Resources

                                                                                    • CRM Community Learning Series

                                                                                      CRM Community Learning Series


                                                                                    • Kaizen

                                                                                      Kaizen

                                                                                    • Functions

                                                                                      Functions

                                                                                    • Meetups

                                                                                      Meetups

                                                                                    • Kbase

                                                                                      Kbase

                                                                                    • Resources

                                                                                      Resources

                                                                                    • Digest

                                                                                      Digest

                                                                                    • CRM Marketplace

                                                                                      CRM Marketplace

                                                                                    • MVP Corner

                                                                                      MVP Corner







                                                                                        Design. Discuss. Deliver.

                                                                                        Create visually engaging stories with Zoho Show.

                                                                                        Get Started Now


                                                                                          Zoho Show Resources

                                                                                            Zoho Writer

                                                                                            Get Started. Write Away!

                                                                                            Writer is a powerful online word processor, designed for collaborative work.

                                                                                              Zoho CRM コンテンツ






                                                                                                Nederlandse Hulpbronnen


                                                                                                    ご検討中の方