how to access the object(current) from eventqueue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2016 01:00 PM
I have an eventqueue : gs.eventQueue("test",current,current); which is triggered via Business Rules.After which in a script action I am getting the parameters of event .So if I try to print the event.parm1 in script action ,I get [object GlideRecord].But after that If I try to get any field from the object ,I am getting "undefined".
My exact requirement is after passing the event.parm1 to script action ,I will call a script include in which I am accessing this object.
eg: gs.eventQueue("test",current,current);--->Business Rule
Script action :
var si= new testingnow(event.parm1);
si.myfun();
Script include:
initialize: function(record) {
this.record = record;
}
- Labels:
-
Integrations
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2016 01:47 PM
Once written to the event Parms its just a string so you need to work it in to any subsequent logic accordingly. Usually with a glide record query to make it useful , I think there may be a user object stored in the event but otherwise it's just paper
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2016 11:33 PM
Thanks for your reply.
I checked the type of event parm & its a object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2016 12:03 AM
This community may give you an idea, how to use event.parm1 -
Re: How to access event.parm1 in mail script?
Mark if it is correct or helpful, feedback is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2016 01:54 AM
Hi Amala,
You should review what parameters you are passing to eventQueue()
..
3.1 eventQueue(String, Object, String, String, String)
Queues an event for the event manager.
3.1.1 Input Fields
Parameters:
- Name of the event being queued.
- A GlideRecord object, such as "current".
- An optional parameter, saved with the instance if specified.
- A second optional parameter, saved with the instance if specified.
- An event queue to add the event to.
3.1.2 Example
if (current.operation() != 'insert' && current.comments.changes()) { gs.eventQueue("incident.commented", current, gs.getUserID(), gs.getUserName()); }
You are calling gs.eventQueue("test",current,current)
So parameters are in order are:
Name of the event being queued = test
A GlideRecord object, such as "current". = current
An optional parameter, saved with the instance if specified. = current
The last mentioned parameter you specify is a glide object, but should be a string - as hinted at by mrswann above.
Best Regards
Tony