- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2021 05:36 AM
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:
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2021 07:41 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2021 05:52 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2021 07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2021 07:27 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2021 07:31 AM
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?