- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2015 07:52 AM
I'm trying to use GlideMultipleUpdate, but it behaves kinda weird...
Here's my code:
var grt = new GlideMultipleUpdate("u_grit_path_import");
grt.addQuery('u_groupname', 'BUILTIN\\Administrators');
//grt.addQuery('u_groupname', 'CONTAINS', 'BUILTIN');
//grt.addQuery('u_groupname', 'IN', 'BUILTIN\\Administrators');
//grt.addQuery('BUILTIN', 'IN', 'u_groupname');
grt.setValue("sys_import_state", 'ignore');
grt.execute();
I've tried with different options which are commented out in the above example, but I keep getting the error message:
*** ERROR *** com.glide.db.GlideSQLException:
See glide log for error details
With the following message in the log:
*** ERROR *** com.glide.db.GlideSQLException:
And when I don't get an error message, he just skips the where-clause and updates all records.
I'm at a loss, any ideas anyone?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 04:13 AM
Just saw this blog and it answers your question
Updating Multiple Entries | Glass 'putan with Service-Now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 04:00 AM
I did try that variant yes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 03:45 AM
var grt = new GlideRecord('u_grit_path_import');
grt.addQuery('u_groupname','CONTAINS','BUILTIN');
grt.query();
while(grt.next())
{
var getImportRow = new GlideRecord('sys_import_set_row');
getImportRow.addQuery('sys_target_table','u_grit_path_import');
getImportRow.addQuery('sys_target_sys_id',grt.getValue('sys_id'));
getImportRow.query();
if(getImportRow.next())
{
getImportRow.sys_import_state='ignored'
getImportRow.update();
}
}
//Note : I am not sure if this is recommended by ServiceNow or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 04:07 AM
Aaaah since the multipleupdate directly accesses the database a problem occurs with parent-child tables.
That explains it.
Also why on a row-by-row update, using a normal gliderecord, it did work.
So how would the update action look like using GlideMultipleUpdate? Or is it just not possible for parent-child tables?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 04:11 AM
I have not used GlideMultipleUpdate much. Hence I am unaware of its capabilities. But I do feel that it would not allow dot walking (Parent-child table).
If you see the code above, I have used the sys id from the outer query to get the related record of import set row table. Hence that would work well. But if you are applying this to a huge set of data, I would advise you to bring this into smaller chunks and process it.