Global Variables in Service Catalog
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 05:02 PM
How to define Global variables in Service Catalog. What i did was, i declared a variable in the onload script as
var total=0;
and trying to access it in the onChange Script as
alert(total) but its throwing error messages
Could anyone help me with it?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 07:33 PM
I believe that starting in Helsinki, ServiceNow restricted access to the typical browser-based JS scopes.
You could try the following:
1. Omit the "var":
total = 0; // instead of var total
2. assign a "document" property:
document.total = 0;
3. Use JQuery to create a custom form element to store your data if the above 2 don't work.