global variable and global function in script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2022 12:17 AM
Hi , All
Can any one tell me how can i define global variable and global function in classless script include so that i can use that in another script include and scripts.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2022 12:35 AM
Classless functions are pretty straightforward, you create them with the same name as class and it can be called from any Server side script.
You can check below article:
Scripting 101: Script Includes - Class vs Classless
For Global variable, have a look at IncidentState script include which comes OOB, for reference how to create Global variables.
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 11:03 AM
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2022 12:41 AM
Hi Prateek,
You can achieve it by creating on Demand script includes. Please follow below link to get more understanding on this.
On Demand Script Include | ServiceNow Developer
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2022 12:48 AM
You can read the below link as well to understand how the variables can be used in other methods of script includes.
Utilities Script Include | ServiceNow Developer
Thanks,
Mohit Kaushik
Community Rising Star 2022