- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2018 09:52 AM
I have a table that extends task, with a workflow that triggers approval requests. I want to send a custom email notification for the approver. The one I created is triggered from the same event (approval.inserted) as the OOB notification for approval requests, but now both are getting sent. The OOB notification doesn't have a weight, so I can't use that to avoid sending it.
The only way I got it working is by applying a filter condition on the OOB notification, but this is not ideal. The other solution I can think of is using a "Run Script" activity that creates the approvals but fires a custom event, though this may be difficult to reverse-engineer from the "Approval - User" activity. Is this the best approach, or is there a better way to avoid changing the Out Of Box notification?
Solved! Go to Solution.
- Labels:
-
Subscription Management
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2018 04:11 PM
For future reference, here is what's needed to fulfill this requirement:
- Create a new event in the event registry, like u_custom_task.approval.inserted
- Create a new notification that is triggered when the your event is fired
- Modify the OOB business rule called "Approval Events (Task)" and in line 40 add two lines of code like the following
else if (current.sysapproval.sys_class_name == "u_custom_task")
event = "u_custom_task.approval.inserted";
The steps above should be enough to add only one custom approval notification. You may want to make this extensible by creating a table that matches your custom events with your custom tables, and in the business rule calling a script include that queries that table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2021 06:52 AM
I want to trigger two custom notifications. I've also added the create event activity in the workflow to trigger those notifications, but only OOB notification got sent to the user.
I am able to send one custom notification through the steps that you have provided.
Can you please suggest me what to do in this case, as I want to send two notifications through the two workflows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 08:14 AM
In my original reply I had suggested creating a table to keep track of all the different custom approvals, but with the current licensing model I would instead keep all logic inside a script include where a function takes the name of a task table as a parameter and returns the custom event. Let's say you call your script include ApprovalNotificationMapping. Then you would use the following in the business rule instead of the code in my original reply:
else event = new ApprovalNotificationMapping.returnEvent(current.task_type);
The function in the script include could be something like this:
returnEvent: function(task_type){
if (task_type == "u_custom_task") return "u_custom_task.approval.inserted";
else if (task_type == "u_custom_task_2) return "u_custom_task_2.approval.inserted";
},

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 02:39 AM
Hi Aaron
I'm trying to accomplish similar thing and I have a question in regards to the line of code:
So i created an event called "u_second_approval.inserted". So, following your code statement mine would something like this:
else if (current.sysapproval.sys_class_name == "Not sure what put in here!!!");
event = "u_second_approval.inserted";
OS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2021 06:53 AM
You have to put the table name there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 08:15 AM
I hadn't noticed this follow-up question I missed. Thanks Charu!