- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 09:30 AM
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.
Please help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 12:09 PM
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
You can name it according to your choice
Step 2 : Create a new business rule on 'sc_req_item' table which runs before insert/update, select the 'advanced' checkbox
(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
Step 4: under who will recieve section, select the 'Event param1 contains recepient'
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 09:46 AM
To send the notification email to the value of the variable head_of_dept_name which is of type Reference to the sys_user table, you can use dot-walking in the email notification's "who will receive" field.
In the "who will receive" field, you can use the following dot-walking expression to reference the value of the head_of_dept_name variable:
This expression will retrieve the email address of the user referenced by the head_of_dept_name variable. The email attribute is used to retrieve the email address of the referenced user.
Note: This assumes that the referenced user has a valid email address in the sys_user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 09:51 AM
@rishabh31 Not possible
you have write br and call event pass user data in parm1 or parm2.
then change notification trigger to event fired in who will receive check parm1 or 2 contains recipients.
Bharath Chintala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 10:07 AM
@BharathChintala sir tried to look for any such BR in community posts for reference but unable to find.
If possible can you please help me with the BR
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 12:09 PM
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
You can name it according to your choice
Step 2 : Create a new business rule on 'sc_req_item' table which runs before insert/update, select the 'advanced' checkbox
(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
Step 4: under who will recieve section, select the 'Event param1 contains recepient'
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