How to view functions referenced in Client script

AnthonyMull
Tera Contributor

Hi community,

 

I am working on our service now instance and trying to debug a client script. However in the client script there is a function being used that is defined somewhere else.

 

How can I find this function so I can understand what it is doing. Below is an example of what I am trying to find with dummy names used.

 

//At the bottom of client script I have.

valiadteMyFormFields('field_01','field_02',errMsg);

 

//I want to see the code for the function named validateMyFormFields, but I dont know where to find it.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @AnthonyMull ,

We can find a fuction name of client script in studio search.

polnilesh99_0-1735298358888.png

please explore below link for verification:

https://www.servicenow.com/community/developer-forum/searching-for-scripts-containing-certain-string...

View solution in original post

8 REPLIES 8

@AnthonyMull 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@AnthonyMull 

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

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

Runjay Patel
Giga Sage

Hi @AnthonyMull ,

 

In Client script you can call UI Script directly so check ui script with function name.

Note: UI Script - its like a repository of function to used by client side script. Its same like script include but script include used for server side and ui script used for client side.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Juhi Poddar
Kilo Patron

Hello @AnthonyMull 

 

To locate the validateMyFormFields function, search for its definition in System Definition > UI Scripts.

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar