Script Action not triggering after event has been processed (scoped application)

Tom_s Azevedo
Giga Contributor

Hi everyone,

I've been trying - for a few hours now - to fire a simple script action when an event has been processed, and cannot get it to work.

Just to be clear, I'm working in a scoped application.

I'm firing the event like this:

var gdt = new GlideDateTime();
gdt.addSeconds(60);
gs.eventQueueScheduled('x_bsmbs_know_cust.kycren.aprovren.chairm', grKYC, grKYC.sys_id, gs.getUserName(), gdt);

The grKYC variable contains the record passed into the event. I've also tried using gs.eventQueue and the result is the same. I'm using gs.eventQueueScheduled just because I thought it could be a timing issue, so I process the event 1 minute later.

The event is being processed correctly, as shown in the image below:

find_real_file.png

 

The Script Action code are simple debug info lines, but they do not show up anywhere, therefore I'm assuming the SA is not firing.

SCRIPT ACTION:

gs.log("### ACTION SCRIPT: kycren.aprovren.chairman ###");
gs.log("Event param 1: " + event.param1);
gs.log("Current number: " + current.number);

So, I ran out of ideas as to the reason the SA is not being called.

Can anyone shed any light on the matter.

Much appreciated.

 

BR

Tomás Azevedo

1 ACCEPTED SOLUTION

Tom_s Azevedo
Giga Contributor

ANSWERING MY OWN QUESTION:

 

I've realised I'm dumb and since it is an scoped application, I was looking at the wrong place for the logs. Onde I looked at the application logs, they were there.

Sorry for the unnecessary question.

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

For some reason "active" is false by default on script actions - I've been caught out by that more than a few times! Can you confirm the SA is active?

Hi, Mike.

 

Yes, it is active.

find_real_file.png

Community Alums
Not applicable

Sorry - I completely missed your point about being in a scoped app.

You can't use gs.log in a scoped app, you need to use gs.info

I've tried with gs.info and it does not show up in the logs either.

I've tested in the Global Scope and it works. Do you know if there is something that prevents Script Actions from being triggered on scoped applications?