To send Notification to a variable of a cat item

rishabh31
Mega Sage

Hi Team,

Need help!

There is a notification on table sc_req_item, whose

When to send: Record Inserted or Updated (Inserted-True)

                          Condition: Item.Name is <Name of cat Item>

                                             And- Variables <Name of cat item> <name of variable> is <True>

 

I want to send this notification email to a variable of this cat item.

Variable (value): head_of_dept_name (Type-Reference (sys_user table))

 

I am unable to do dot walk into this variable of cat item from 'who will receive' > 'Users/Groups in fields' as I want to send this notification to the variable head_of_dept_name.

rishabh31_0-1683044989458.png

 

 

Please help!

1 ACCEPTED SOLUTION

Karan Chhabra6
Mega Sage
Mega Sage

Hi @rishabh31 ,

You can send that 'head_of_dept_name' field as a parameter via events and then in who will recieve section, select the checkbox 'event param1 contains recepient' or  'event param2 contains recepient'.

 

Please follow the below steps:

Step1: Create a new event by registering it in the event registry module

KaranChhabra6_0-1683053150966.png

You can name it according to your choice

KaranChhabra6_1-1683053292901.png

 

Step 2 : Create a new business rule on 'sc_req_item' table which runs before insert/update, select the 'advanced' checkbox

KaranChhabra6_2-1683053478657.png

KaranChhabra6_3-1683053861838.png

(function executeRule(current, previous /*null when async*/) {

	gs.eventQueue('ritm.creation.notification',current,current.variables.head_of_dept_name,gs.getUserName());

})(current, previous);

 

Step 3 : Open your notification record and click on 'advance view' ui action link, under when to send section

select 'send when' as 'event is fired' and select the event name that you created above

 KaranChhabra6_4-1683054040282.png

KaranChhabra6_5-1683054195040.png

 

Step 4: under who will recieve section, select the 'Event param1 contains recepient'

KaranChhabra6_6-1683054329677.png

 

This can be achieved via flows as well without the need of creating events.

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks,

Karan

View solution in original post

5 REPLIES 5

Thank you @Karan Chhabra6 for the detailed solution. Its working as expected🙂