Error - Script error encountered when changing this field - please contact your System Administrator

vimal909
Mega Contributor

Hi,

I have written the below script to hide Email client button for some of my catalogs. However it is causing an issue on a "Manager Name" Reference field on form. End user getting "Script error encountered when changing this field - please contact your System Administrator" error after clicking on any Requested Item and able to see hidden fields because of the error.

Client script on onLoad():-

function onLoad() {

    //Type appropriate comment here, and begin script below

         

      var abc = g_form.getValue('approval');

      var abc1 = g_form.getValue('u_catalog_type');

if((abc != 'approved') && (abc1 != 'Service Catalog')){

      $('email_client_open').hide();

}

      }

How can I fix the issue?

Thanks in Advance.

Regards,

Vimal

1 ACCEPTED SOLUTION

vimal909
Mega Contributor

Issue got fixed after making the Client script to Default view instead Global.


View solution in original post

17 REPLIES 17

Yes Kalai. We had raised a ticket on HI agent has replied "This is the one that needs fixing to remove the DOM maniplulation causing the client side code to error."




I have disabled the script and tested, we are not seeing any error. If the script is in active we are seeing the above error.


can you paste you script to show us how are you using it.


-Anurag

DOM itself causing an issue here. Because of this DOM reference field is getting the error when end user opening the requested item. Do you have any idea how trace the error for an end user as only end user getting the error.


using plain javascript ...



var hideEmailIcon = document.getElementById('email_client_open');


hideEmailIcon.style.display='none';



Note : My instance is on Eureka...


I tried that also Kalai. Still it is giving the same error.