
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2016 09:27 PM
Hi All,
I need to send notification after record is deleted from table.
Following is my scenario.
When project is removed from portfolio, portfolio manager should receive notification.
Project and portfolio relationships are stored in pm_m2m_portfolio_project table and this table is referenced in related list on portfolio form.
Hence, i created after delete business rule on pm_m2m_portfolio_project table which generates event. This event is handled in email notification.
But, i am facing issue here and event will not be processed since record in already deleted from pm_m2m_portfolio_project table.I won't get current, previous object in business rule since record is already deleted.
I tried to set value of portfolio manager in on after delete business rule before sending event.But, it's not working and event is not getting processed.
Also, i tried to set value of portfolio manager in on before delete business rule with no success.
Another option was to create BR on Audit deleted records table and create mail script to parse payload XML for email content.But, this will not work in this case since payload doesn't contain portfolio manager name.
Please let me know solution to this issue.
Regards,
Sachin
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2016 10:45 PM
Thanks for the update.
You could JSON encode an object and pass it in the parameter, then use a mail script in the notification
Reference : by sabell2012
Mini-Lab - Events: Passing Objects

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2016 10:08 PM
Hello Sachin,
Try to pass "null" instead of "current" when you create the event.
gs.eventQueue("PASSEVENT NAME HERE", null, "parm1", "parm2");
Events and Email Notification - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2016 10:24 PM
Thanks Pradeep!!
Now, i am able to get event processed successfully.
How can i get deleted record details ( project manager name, project manager in email notification which is handling this event?
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2016 10:45 PM
Thanks for the update.
You could JSON encode an object and pass it in the parameter, then use a mail script in the notification
Reference : by sabell2012
Mini-Lab - Events: Passing Objects