- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 05:10 AM
I am in the process of converting a global scheduled job script into a custom scoped application. The job should fetch some data from an external service, fill the application scope local table with data.
Inserting records into global tables from a global scheduled script works well with following script:
var srv = new GlideRecord("cmdb_ci_server");
srv.get("correlation_id", hKey);
srv.correlation_id = hKey;
srv.host_name = "testhost";
srv.updateWithReferences();
When I try to run this script within a custom application on a custom application table I am not able to insert anything.
What am i doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 03:27 AM
Ok finally i got it working. The problem was that i was not using the newer 'scoped scripted API' that can be found here:
then this script actually works for me without problems:
var srv = new GlideRecord('cmdb_ci_server');
srv.initialize();
srv.setValue('host_name', 'testhost');
srv.insert();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2016 11:34 PM
Hi Wolfgang,
OOTB you should be able to create/update record on this table from other scope. However can you please check if can create/can update checkbox(Go to the table "cmdb_ci_server" and related list "Application Access settings") is set to true for other scopes in your instance.
More info here
Application Access Settings - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 12:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2016 03:27 AM
Ok finally i got it working. The problem was that i was not using the newer 'scoped scripted API' that can be found here:
then this script actually works for me without problems:
var srv = new GlideRecord('cmdb_ci_server');
srv.initialize();
srv.setValue('host_name', 'testhost');
srv.insert();