- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 08:53 PM
I've the following in a script include
function: doSomething(sysid){
var inc = new GlideRecord('incident');
if(inc.get(sysid)){
var getSomeOtherValue = this.getOtherValue();
inc.setValue('xxxx', 'yyyy');
inc.setValue('zzzz', 'aaaa');
if(getSomeOtherValue){
inc.setWorkflow(false);
}
inc.update();
if(<check if setWorkflow is set to false on the inc object>){
this.doSomethingExtra();
}
}
}
Is there a way to check the if() condition above?
I know I can simply do this
function: doSomething(sysid){
var inc = new GlideRecord('incident');
if(inc.get(sysid)){
var getSomeOtherValue = this.getOtherValue();
inc.setValue('xxxx', 'yyyy');
inc.setValue('zzzz', 'aaaa');
if(getSomeOtherValue){
inc.setWorkflow(false);
}
inc.update();
if(getSomeOtherValue){
this.doSomethingExtra();
}
}
}
but I was wondering if I can verify that by any OOTB method on the GlideRecord class. For eg: We have inc.isValidRecord() method, so is there a inc.isSetWorfklowFalse() or something similar?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 09:47 PM
setWorkflow(false) is used to avoid business rule, notifications, flow when record is inserted or updated and is applied in real-time
there is no way to check what you are asking
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 09:47 PM
setWorkflow(false) is used to avoid business rule, notifications, flow when record is inserted or updated and is applied in real-time
there is no way to check what you are asking
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2025 10:01 PM
Hi @Nisar3
as the GlideRecord object can be modified and extended like any other javascript object you can incorporate your own method to achieve it
Maik