added a g_form info message and client scipt started working?!

cchacha
Mega Guru

Hi All,

 

My client script was working fine until it stopped working, I dont know if its versions of instances.

Anyway this is the beginning of my script.

function onLoad() {
 
    checkUserGroupMembershipBySysId();
 
Until I added g_form.addInfoMessage("twt")  on the line before this function, the script wouldn't work.
 
What is going on here, is this because of version instance, possible ordering issue?
 
I have removed the info message and the script is still working now.. what happened why is the script working now..was it cache? I didnt clear my cache.
 
Should I just revise the client script and make an acl instead to be sure this doesnt happen again
 
Thanks,
Carol
 
 
5 REPLIES 5

sarah_bioni
ServiceNow Employee

Hi @cchacha , 

 

Could you please provide a screenshot of your Client Script?

groupSysid = ""; is a sysid of a hardcoded group. part of the checks the script does is check if the logged in user is part of this group, if they are this script then comes to be true. A field should then be avaiable onLoad for the user to see.clientscritptsc.png

Tejas Adhalrao
Tera Guru

Hi @cchacha  ,

 this might be  syntax issue can you please full client script code

 

 If you found my solution helpful, please mark it as Helpful or Accepted Solution...!

thanks,

tejas

Email: adhalraotejas1018@gmail.com

LinkedIn: https://www.linkedin.com/in/tejas1018

Ankur Bawiskar
Tera Patron

@cchacha 

we don't know your complete script and business requirement

share that so that we can help better

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader