Trigger Approval Notification on state changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
I have a requirement to trigger approval notification only when state changes to Pre-Check Completed (custom state) on RITM. Currently It triggering only when approver is attached to RITM not on the states changes.
Please find the below event , BR , Notification condition overview and let me know where need to adjust the code.
event Name :precheck.completed
Table :sc_req_item
Br: Trigger Notifctaion on RITM PreCheck / After - Update
Table :Sc_req_item
script :
Notification
Table: sysapproval_approver
Condition: sysapproval.getTableName() == 'sc_req_item' && sysapproval.state == 15
Looking forward for your response.
Thank you in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Since you have a Business Rule triggering an event, assuming that is working correctly, your Notification should be set to Send when 'Event is fired', not 'record inserted or updated' then choose your event in the Event name field
You likely then don't need the conditions, if your BR is only triggering the event when it should.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Brad Bowman ,
Thanks for reply !
Yes, I mentioned the same way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi Deepika,
From what you've described, the issue is occurring because the event is being triggered on the sc_req_item table, but the notification is configured on the sysapproval_approver table. Since the event is not fired on the approver record, the notification never gets triggered during the RITM state change.
To resolve this, you can simply move the notification to the sc_req_item table (same as where the event is triggered). Update the notification as follows:
Table: sc_req_item
Send When: Event is fired
Event name: precheck.completed
Condition: current.state == 15
This way, the notification will properly trigger when the event precheck.completed is fired on the RITM.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @M Iftikhar ,
Thanks for reply!
I made the changes as suggested but no luck.
BR:
When i making all on sc_req_item , no approver gets attached on RITM .
Thanks
Deepika