- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2019 07:41 AM
I'm trying to pass an event to an email notification, but it is empty. Can anyone help me solve this?
I have a script include with the following code:
var table = gs.getProperty('searchtables')
var checkFields = new GlideRecord(table);
checkFields.query();
gs.eventQueue('no_tables', '', checkFields.getClassDisplayValue());
I've checked that "checkFields.getClassDisplayValue()" has a value, which it has.
Then I've a Email Script as follows:
var string = event.parm1;
email.setSubject('Table ' + string + ' failed');
template.print(string);
But event.parm1 is then empty. I get the email but without the value from parm1
Does anyone know why?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2019 01:47 AM
Got it to work, added gs.getUserID();
gs.eventQueue('x_225566_gdpr.no_tables', '', gs.getUserID(), checkFields.getClassDisplayValue());
My notification has no table, that's why I wanted to have an empty string... Will try with null as well if that's best practice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2019 08:43 AM
You need to pass current or checkFields:
gs.eventQueue('no_tables', checkFields, checkFields.getClassDisplayValue());
Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2019 01:35 AM
Tried that as well, got the following error:
"getEventTarget() called with invalid record reference" , "the record may have been deleted".
Found this KB, https://hi.service-now.com/kb_view.do?sysparm_article=KB0522706 but there's no workaround.
Do you know a way around this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2019 01:40 AM
can you try passing current if you are using business rule? For Which table have you created event? For which table you have written BR?
Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2019 01:45 AM
Yeah you can't use an empty string, if there's no current object you can use null
gs.eventQueue('no_tables', null, checkFields.getClassDisplayValue());