Queue an event without the 'current' record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 03:19 PM
I'm working on an Inbound Email Action. I have it working, but the person requesting it wants me to 'user-proof' it, i.e. send a "failed" notification with the 'source' email in the event the user specifies some invalid data.
So, I know how to enqueue an event, and send an email notification based on that event. But can I enqueue an event without the 'current' record?
Syntax for gs.eventQueue is gs.eventQueue("event-to-be-queued", current-record, optional-parm-1, optional_parm-2);
Obviously, the event name is mandatory. And it also appears that 'current-record' is also mandatory.
My problem is that since the user had a typo, or otherwise specified some 'invalid' data, the insert of the target record failed. And while there is a sys_id to the 'in-process' record when the gs.eventQueue() runs, when the email notification actually gets around to it, the sys_id is no longer valid, and the email notification fails.
I've tried gs.eventQueue("event-name", , optional-parm-1); but that fails, too, because of what I believe is no 'current record'.
Ideas?
Thanks,
Dave
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2019 08:05 AM
It worked!...Thanks a lot ...
Regards,
Snehal Madakatti

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2021 01:14 AM
I know it's 3 years ago but you can queue an event without the 'current' record like this:
gs.eventQueue("<Event.name>", "", "", "<parm1>", "<parm2>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2021 06:43 AM
Wanted to thank you for this. I had tried and abandoned this approach earlier because it was bombing out when trying to pass two event parms. But I was only passing in 4 arguments in total, kind of like this:
gs.eventQueue("<Event.name>", "", "<parm1>", "<parm2>");
In your approach, you're passing 5 arguments into gs.eventQueue instead. And though it works, everything I've read suggests this method only accepts 4 parameters. Do you have any references for what the 5th parameter is?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2021 08:03 AM
Sorry Andy, i do not have any references. I'm using this hack/fix for some years now and i don't know if i found it somewhere or if i stumbled on it by accident in trying to achieve this.
There is a risk it will no longer work after future upgrades and patches. But like i said it still works for me after i start using it a few years back.