HOW TO PRINT THE RESULT OF A BUSINESS RULE ON THE CONSOLE?

hibye
Giga Contributor

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??

6 REPLIES 6

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.


randrews
Tera Guru

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.