- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 06:53 AM
I want to make a glide record query that querys a knowledge base and then sets all articles in it to "disable_commenting = true", however, my script isnt working. What is wrong here?
//Query the LegalEase knowledge base and find records that have disable commenting set to false. Update those records to make disable commenting true.
var true_commenting = new GlideRecord('kb_knowledge');
true_commenting.addQuery('kb_knowledge_base', 'LegalEase');
true_commenting.addQuery('disable_commenting', 'false');
true_commenting.query();
while (true_commenting.next()) {
true_commenting.disable_commenting = 'true';
true_commenting.update();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 06:56 AM
Hi Josh,
A couple tweaks (noted in the comments)
var true_commenting = new GlideRecord('kb_knowledge');
true_commenting.addQuery('kb_knowledge_base', 'SYS_ID_OF_LEGALEASE'); // Requires a SYS_ID, not a name
true_commenting.addQuery('disable_commenting', false); // true/false values don't need quotes, they are JavaScript keywords
true_commenting.query();
while (true_commenting.next()) {
true_commenting.disable_commenting = true; // same as above
true_commenting.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 06:56 AM
Hi Josh,
A couple tweaks (noted in the comments)
var true_commenting = new GlideRecord('kb_knowledge');
true_commenting.addQuery('kb_knowledge_base', 'SYS_ID_OF_LEGALEASE'); // Requires a SYS_ID, not a name
true_commenting.addQuery('disable_commenting', false); // true/false values don't need quotes, they are JavaScript keywords
true_commenting.query();
while (true_commenting.next()) {
true_commenting.disable_commenting = true; // same as above
true_commenting.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2016 07:07 AM
Thanks, Chuck!