- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 02:23 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 03:12 AM
Hi @AnthonyMull ,
We can find a fuction name of client script in studio search.
please explore below link for verification:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 02:37 AM
Hi
Could you help me with the screenshot of your client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 02:52 AM
To find this function, start by checking Script Includes under System Definition, as functions are often defined there for reuse. If it's a client-side script, look under System UI > UI Scripts, which houses global JavaScript files. You can also use the Global Text Search in ServiceNow to search for the function name across all scripts.
If these don't help, open the browser's developer tools (F12) while on the form and type console.log(validateMyFormFields) in the console to see where it's defined or its content. Additionally, review Client Scripts under System Definition to check if the function is defined in another related script.
These methods should help locate the function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 03:12 AM
Hi @AnthonyMull ,
We can find a fuction name of client script in studio search.
please explore below link for verification:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 03:44 AM
It could be present within a UI script.
Did you search there?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader