Event isn't firing for workflow approval in custom table for a scoped application.

Noah S_
Kilo Contributor

Hello, I am working on an application that has an approval on a table not extended from the task table. I am trying to make an event to activate when this approval is started. This would then activate a notification to send an email notification out to those that need to approve. My problem is that the event and notification isn't firing unless I create it in the global scope, which I cannot do. From what I can tell it seems like it is because of the naming of the event. I can't name it exactly right when it's scoped see first photo for scoped event. Any help to fix this problem would be great.find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Ok. you will have to make changes to Approval Events (Non-Task) BR on Approval table. 

It will only work for global. For scoped, either you need to modif this BR or create a new one.

 

Because, the script join table name with approval.inserted. But since you also have scope, you will also prefix the scope name in the script.

 

var event = current.source_table;
switch (current.state + "") {
case 'cancelled':
event += ".approval.cancelled";


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

6 REPLIES 6

Noah S_
Kilo Contributor

Yes they are both on the approval table. And I am not calling the event via script. When the event is global it is automatically called when the workflow hits the approval stage, but not when it is scoped.

Ok. you will have to make changes to Approval Events (Non-Task) BR on Approval table. 

It will only work for global. For scoped, either you need to modif this BR or create a new one.

 

Because, the script join table name with approval.inserted. But since you also have scope, you will also prefix the scope name in the script.

 

var event = current.source_table;
switch (current.state + "") {
case 'cancelled':
event += ".approval.cancelled";


Please mark this response as correct or helpful if it assisted you with your question.