
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 01:40 AM
Hi,
I'm trying to call a REST message from a Scheduled script:
Executing the script I've got this error:
"Cannot find default value for object."
Any idea?
Many thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 03:38 AM
Hi,
seems issue with the execute method
check docs link below
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 02:21 AM
Hi Nicolo,
The job is created in which scope?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 02:30 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 02:36 AM
I've notice right now that for every execution there are two errors one posted before, the other is:
org.mozilla.javascript.EcmaError: Cannot find default value for object.
Caused by error in <refname> at line 4
1: printLog2();
2: function printLog2() {
3: var r = sn_ws.RESTMessageV2('x_414554_nozomiapp.nozomi', 'get_assets');
==> 4: var response = r.execute();
5: gs.info('REST message');
6: }
so it seems the execute method throw: "Cannot find default value for object"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 03:38 AM
Hi,
seems issue with the execute method
check docs link below
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 06:22 AM
I found it just missing the new in:
var r = new sn_ws.RESTMessageV2('x_414554_nozomiapp.nozomi', 'get_assets');
my bad 🙂