Event trigger from one table to another table

ankitaverma
Giga Expert

Hi All,

I have a requirment in which when i click a button a user is inserted in approval table , a default attachment is added to it and a mail is triggered.

My notification is build in a scoped application and my UI action is in Global application.

This i UI action script//

var rec = new GlideRecord('sysapproval_approver');

rec.initialize();

rec.approver = current.xuz;

rec.state= "requested";

rec.source_table = "x_test;

rec.insert();

GlideSysAttachment.copy("sys_properties", "6aac69414fc9e64079ed188af110c75c", "sysapproval_approver", rec.sys_id.toString());  

//gs.eventQueue("abc_notification", rec,rec.approver );

current.state = 12;

//update current state

current.update();

action.setRedirectURL(current); // stay on this form

Through this a user is getting inserted in approval table with the default attachment but i am not able to understand how i can trigger a event as my UI action is not running in approval table. It is running on a custom table.

Please help..

Thanks,

Ankita verma

5 REPLIES 5

aniketgore
Giga Expert

You want to trigger a event from approval table right? You can write a business rule on Approval table and fire the event from it.


Hi Aniket,



I want the event to be triggered from a Ui action which is on a custom table.



Thanks


Use gs.evenQueue("event name", "Glide object", "Param1", "param2"); in UI action(Server Side).


anurag92
Kilo Sage

Though UI action is not running on custom table, you created an object of Approval table, and this object is being passed in EventQueue. So, this would run error-free without issues. Are you facing any issues/challenges? or is the notification not being called?