
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2020 01:08 AM
var GenericIncidentInterface = Class.create();
GenericIncidentInterface.prototype = Object.extendsObject(_ObjectTablesHelper, {
type: 'GenericIncidentInterface',
errorValues: 'az.incident.generic.interface.errors',
logFilter: 'az.incident.generic.interface.logging.functions',
This is part of a code on a interface table for incident.
- Why do we have the base script include (_ObjectTablesHelper) name starting with underscore(_) ? - Does that make it nay special? I understand that a function starting with an underscore makes it private for any calls from external to the script include. But wondering why have a similar naming convention for script include?
Regards,
Anish
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2020 01:38 AM
Hi there,
"I understand that a function starting with an underscore makes it private for any calls from external to the script include".
You will indeed see in a lot more Script Incldues, especially functions within a Script Include starting with an underscore. Though this does not make the function private. It's just a naming convention, nothing more. A naming convention that that function is supposed to be used only within that Script Include. Though you could still call functions like these directly from for example a Business Rule.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2020 01:38 AM
Hi there,
"I understand that a function starting with an underscore makes it private for any calls from external to the script include".
You will indeed see in a lot more Script Incldues, especially functions within a Script Include starting with an underscore. Though this does not make the function private. It's just a naming convention, nothing more. A naming convention that that function is supposed to be used only within that Script Include. Though you could still call functions like these directly from for example a Business Rule.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2020 01:47 AM
Using the underscore as a prefix of a method is just a best practice to have a visual aid of which methods are intended for internal use within your script include. It's not the same as using private in a class or struct in other programming languages because you can still call the method with underscore outside of the script include.
Mm... good to know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2022 03:35 AM
Hi Mark,
I had define a function starting with underscore(e.g. _gmmpValue()) in a client callable script Include but it is not working. The function didn't get called from Client script. Please assist on this.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 12:16 AM
Don't forget to call the function with the underscore "_" before the name of your function and this will work
Ex : nameOfYourScript()._gmmpValue()
Regards