Email Notification on parent table

Mutsumi
Kilo Contributor

Hi experts,

How to send email notification on Parent table when child tables' record is updated/inserted.

I created an email notification on parent table, but it doesn't work triggering records are updated/inserted on child tables.

I want to use Notification not Business rule, so that I want to use Email Digest and Subscribe email (Personal Notification) function.

Does anyone have any ideas? Thank you in advance.

8 REPLIES 8

Slawek_Radziewi
Kilo Sage

You can i.e. create business rule on child table when record updated/inserted create event New.Notification.

Then add your new Event as trigger to notification you created.

Thank you for replying.

I want to use one common email notification for several tables which are all extended from one common table.

So I'd rather not to use business rule on every child table.

Do you have any idea?

If you meant extended table you might try below which maybe not perfect.

1. Create notification on custom table (create a table for that purpose).

2. Add business rule on Parent table with trigger for our notification.

find_real_file.png

var mail = new GlideRecord('u_custom_table_email');
ignored.initialize();
ignored.u_recipients = '';
ignored.u_sender = '';
ignored.u_subject = '';
ignored.u_body = '';
var newSysId = mail.insert();
sys_email.instance = newSysId;
sys_email.target_table= "u_custom_table_email";
sys_email.update();

 

 

Uncle Rob
Kilo Patron

When you say Parent/Child are you talking about a reference on the child to the parent?  Or are you talking about one table that's extended from the other?  For this answer I'm going to assume the first case.

So, you want to send a notification *ABOUT* the parent when an event happens *ON* the child, correct?

If so, can't you just dot-walk up from the child?