"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

Allen Andreas
Administrator
Administrator

Hello,

Without seeing your exact code or any screenshots of your BR, we can only speculate.

Are you using something like this format:

gs.info("Sample message");

If you aren't seeing anything in your system log, then it could mean the business rule isn't even running...

Check your conditions or consider removing all conditions first, then test things, then start to slowly add conditions back.

Ensure that the business rule is "Active" and also ensure that you have everything set on the right table and have selected an appropriate option such as: Insert, Update, Delete, Query.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allan,

I am creating a BR that displays the value calculated from the related list in the period field of the "Incident" table by referring to the link below.
So I want to use gs.info.

https://community.servicenow.com/community?id=community_question&sys_id=512f3269db58dbc01dcaf3231f96...

 

find_real_file.png

BR

 

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(); //related list field name

}
current.u_total_time_worked.setDateNumericValue(total); // incident table field name
gs.info("log");

}

 

Regard

Jim Coyne
Kilo Patron

Add another "gs.info" as the first line in your BR to make sure it is running.  I'm suspecting there's an error before your current "gs.info", but as Alan said, hard to tell with the limited info we have.  Can you post the script?

Hi, Jim

It is a script, but it is the content that was replied to Allan.

Regard.