In Output screen unable to see any script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
var gr = new GlideRecord('incident');
gr.addEncodedQuery(
'sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()'
);
gr.query();
Can anyone please tell me what is wrong with this script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@neelamallik
Correct Script :
var gr = new GlideRecord('incident');
gr.addEncodedQuery(
'sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()'
);
gr.query();
gs.info(gr.getRowCount());
*************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @neelamallik,
In the output section, only the output is shown, not the code.
If the code is used in the correct way, it will work properly.
Copy and paste the sample code I have shared; it will make your work easier.
Paste this code in your Background Script!
If you feel that you received help because of me, please mark it as helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @neelamallik ,
Please try below script, you need to print some output in your script
var gr = new GlideRecord('incident');
gr.addEncodedQuery(
'sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()'
);
gr.query();
if(gr.next()){
gs.print("Number = " + gr.getValue('number'));
}
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @neelamallik ,
Use this :
'sys_created_onONToday@javascript:gs.beginningOfToday()@javascript:gs.endOfToday()'
This I copied from the filtered condition copy query and noticed some query mistake in this and your's..
If my response helped mark as helpful and accept the solution..
