Client script is not working on my Instance.

aakankshapl
Tera Expert

Hello
On my instance any type of client script is not working. My story is stuck from two days because of this issue.
What could be reason and solution for this to resolved.
Your help will be alot for me 

Thanks & Regards,
Aakanksha Lavande

21 REPLIES 21

Amit Pandey
Kilo Sage

Hi @aakankshapl 

 

If there is any client script in your instance scripted wrongly, it will stop all the client scripts. You need to check since when you're experiencing it and identity any client script which was updated recently.

 

Regards,

Amit

All other client script are the OOB

Hi @aakankshapl 

 

Can you share the script along with what is your requirement?

 

Regards,

Amit

I need to add a new custom field to the Account form to facilitate the tracking and validation of email domains that are trusted by each client.
This field, named "Trusted Email Domain(s)" (u_trusted_email_domains), will be a string field where users can input email domains that are considered secure and reliable for communications related to the account.
Domains must be entered with an "@" sign at the beginning, and multiple domains should be separated by a comma.


function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '' ) {
      return;
   }

   var trustedDomains = g_form.getValue('u_trusted_email_domain_s');
    alert(trustedDomains);
    var domainArray = trustedDomains.split(', ');

    for (var i = 0; i < domainArray.length; i++) {
        if (!domainArray[i].startsWith('@')) {
            g_form.addErrorMessage('Each domain must start with "@"');
            return false;
        }
    }

    return true;
}

Hi @aakankshapl 

 

Can you try the following onChange client script-

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '' ) {
      return;
   }

   var trustedDomains = g_form.getValue('u_trusted_email_domains');
   var domainArray = trustedDomains.split(',');

   for (var i = 0; i < domainArray.length; i++) {
       var domain = domainArray[i].trim(); // Trim to remove extra spaces
       if (!domain.startsWith('@')) {
           g_form.addErrorMessage('Each domain must start with "@"');
           g_form.clearValue('u_trusted_email_domains'); // Clear the field
           return false;
       }
   }

   return true;
}

 

Regards,

Amit