Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 01:26 PM
Newbie here. Any Help appreciated. I get this error when trying to save:
Could not save record because of a compile error: JavaScript parse error at line (3) column (16) problem = missing ; before statement (<refname>; line 3)
(function executeRule(current, previous /*null when async*/)
{
Var makeVIP = new GlideRecord('sys_user');
Var q1 = makeVIP.addQuery('title', 'COTAINS', 'VICE');
q1.addOrCondition('title', 'CONTAINS', 'Vice');
q1.addOrCondition('title', 'CONTAINS', 'CHIEF');
while (makeVIP.next()) {
makeVIP.vip = true;
gs.info("ADMIN: " + makeVIP.name + "with title: " + makeVIP.title + " is now a VIP.");
makeVIP.update();
}
})(current, previous);
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 08:21 PM
update as this
(function executeRule(current, previous /*null when async*/) {
var makeVIP = new GlideRecord('sys_user');
makeVIP.addQuery('title', 'CONTAINS', 'VICE');
makeVIP.addOrCondition('title', 'CONTAINS', 'Vice');
makeVIP.addOrCondition('title', 'CONTAINS', 'CHIEF');
makeVIP.query(); // Execute the query
while (makeVIP.next()) {
makeVIP.vip = 'true'; // Use string for boolean
gs.info("ADMIN: " + makeVIP.name + " with title: " + makeVIP.title + " is now a VIP.");
makeVIP.update();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2025 08:21 PM
update as this
(function executeRule(current, previous /*null when async*/) {
var makeVIP = new GlideRecord('sys_user');
makeVIP.addQuery('title', 'CONTAINS', 'VICE');
makeVIP.addOrCondition('title', 'CONTAINS', 'Vice');
makeVIP.addOrCondition('title', 'CONTAINS', 'CHIEF');
makeVIP.query(); // Execute the query
while (makeVIP.next()) {
makeVIP.vip = 'true'; // Use string for boolean
gs.info("ADMIN: " + makeVIP.name + " with title: " + makeVIP.title + " is now a VIP.");
makeVIP.update();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2025 05:38 AM
Thanks. That did it!