how to write the Script include in service now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 03:55 AM
Hi Team,
i have wriiten bellow mention Script include but when i go to in Script include and paste the same then click on check then i got the error (ERROR at line 1: Expected an assignment or function call and instead saw an expression) Pls. Suggest
Var newinclude = Class.create();
- newinclude.prototype= {
Initialize : function(){
},
myFunction:function()
{
var t = gs.getUserID();
- gs.print("Print the value:" +t);
}
type: 'newinclude'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 03:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 04:00 AM
V should be in Lower Case in "Var" at 1st line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 06:47 AM
now it working fine. Thanks for Update Sir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2015 07:04 AM
name of script include =newinclude
var newinclude = Class.create();
newinclude.prototype = {
myFunction:function()
{
var t = gs.getUserID();
gs.print("Print the value:" +t);
},
type: 'newinclude'
};
P.S- i have removed initialize function as it was not being used.