HOW TO PRINT THE RESULT OF A BUSINESS RULE ON THE CONSOLE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 03:11 AM
for example i want to print all the active records
i created a business rule by following conditions
when to run:
BEFORE INSERT/UPDATE
SCRIPT:
var x=new GlideRecord('incident');
x.addActiveQuery();
x.query();
while(x.next())
{
gs.print('active record number'+x.number);
}
but i am not getting any out put on the console
i want to test all the GlideRecord methods with output how it is possible??
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 03:43 AM
Hi Shabbir,
The script is correct except for mis-spelled gs.addInfoMessage("your message");
How are you testing the same? After writing business rule, are you updating the incident ? Only once you update/insert a new incident is the BR (script) which you wrote will run and display the result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 08:48 AM
console.log might put the output in the console for you.. i have only ever used that from a ui page though never in a br... generally for a br i use an add info message or a gs.log.