- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2018 03:12 AM
Hello,
I am very new to ServiceNow and trying to learn/create application using studio.
I have created a table from where using "UI Action" i could able to read data from that new table. now i would like call a ECC queue for this. Written below test code but when i click on UI action menu its return error "org.mozilla.javascript.EcmaError: "Test " is not defined.
Can we not call Script include by this?
+++++ Code in UI action +++++
var test = new Test();
test.TestSync();
+++++++++++++++++++
+++++ Code in Script include +++++
var Test =Class.create();
Test.prototype={
initialize :function(){
gs.info("Test");
},
TestSync :function(){
var jspr = new JavascriptProbe('MyMIDServer');
jspr.setName('TestLog');
jspr.setJavascript('ms.log("TestLog");');
jspr.create();
},
type :'Test'};
+++++++++++++++++++
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2018 10:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2018 11:27 AM
The JavaScript Probe is healthy. No need to change it.
- Not sure why you cant find the logs in agent logs.
But this is what you can do to see if your probe worked.
Navigate to
Mid Server -> Servers -> (Click on your Mid Server)-> From related links Click on Grab MID logs -> You should find agent0.log0 of type Output.
Wait for sometime to receive the Input for agent0.log0. Once you get it, open the attachment that comes with it named something like payload.xml.
Then do a CNTRL+F and search for your log statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2018 09:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2018 10:41 PM
You need to call ms.log(String) to print messages in the agent log from mid server javascript.