Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

can't see javascript to debug in business rules

hikerclimber
Giga Guru

Hi,

 

I don't see Javascript in debugger tool when dealing with business rules. Is this because Javascript runs server side? So I have to use the log to debug?

 

Thanks,

Aniket

3 ACCEPTED SOLUTIONS

GlideFather
Tera Patron

Hi @hikerclimber,

 

some business rules are code-less, if the Advanced field is unchecked, it can set message and field values without script.

 

Perhaps this is the situation. Can you share what happened? Any screenshot or steps to replicate.

 

BR being server side is not the problem.

_____
100 % GlideFather experience and 0 % generative AI

View solution in original post

Oh k. I just have a gs.info in the advanced tab so that is probably why. I will try adding some meaning functions to see if I can debug. 

View solution in original post

I got it working. I was forgetting to put the breakpoints in the debugger. 

View solution in original post

6 REPLIES 6

GlideFather
Tera Patron

Hi @hikerclimber,

 

some business rules are code-less, if the Advanced field is unchecked, it can set message and field values without script.

 

Perhaps this is the situation. Can you share what happened? Any screenshot or steps to replicate.

 

BR being server side is not the problem.

_____
100 % GlideFather experience and 0 % generative AI

Oh k. I just have a gs.info in the advanced tab so that is probably why. I will try adding some meaning functions to see if I can debug. 

So I added the following code but it won't show in debugger. I put SAP in the short description field. 

 

"(function executeRule(current, previous /*null when async*/ ) {

    var sapIncs = new GlideRecord("incident");
    sapIncs.addActiveQuery();
    sapIncs.addQuery("short_description", "CONTAINS", "SAP");
    sapIncs.query();

    var myLog = "";
    while (sapIncs.next()) {
        myLog += sapIncs.number + ",";
    }

    gs.addInfoMessage("These records are active SAP Incidents:" + myLog);

})(current, previous);"

Hi @hikerclimber,

 

is your BR executed on before/after/async and insert/update?

 

Please share the BR definition, this is too abstract to help you

_____
100 % GlideFather experience and 0 % generative AI