"gs.info" executed by Business Rule is not displayed in application log.

Nakata1
Tera Contributor

I tried "gs.warn", "gs.error", in addition to gs.info, but no log is displayed in the application log.

Is there a solution?

1 ACCEPTED SOLUTION

So that screenshot shows the BR being an "after" BR and NOT a "display" one.  Can you please change it to "display" and then show a screenshot of the "Advanced" tab as well please.

View solution in original post

20 REPLIES 20

Moving the gs.info to the top. No log is output to System log. Is BR not working?

 

gs.info("JC-log");

function onDisplay(current, g_scratchpad) {

var total=0;


var grid = new GlideRecord('task_time_worked'); //related list table name


grid.addQuery('incident', current.getValue('sys_id'));


grid.query();


while(grid.next()){


total+= grid.time_worked.dateNumericValue();


}
current.u_total_time_worked.setDateNumericValue(total);

}

I guess I need to be careful what I say.  Switch it to:

function onDisplay(current, g_scratchpad) {
    gs.info("JC - the BR is in fact running");
    ...and then the rest of your code

It has to be within the code block, not "at the top".

I modified the script, but it does not appear in the system log. Is BR not working?

It would seem like it is not getting executed.  What table is it running on (screenshot please)?

find_real_file.png

Running at the Insident table. The script wants the total time of "Time Work" in the related list to be displayed in the "total_time_worked" field.