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

SanjivMeher
Kilo Patron
Kilo Patron

Event does work from scoped app.

 

while calling the event, make sure you use the event name and not the suffix.


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

Noah S_
Kilo Contributor

Hello,

 

Thank you for your feedback. I used the event name not the suffix when creating the notification. But as far as calling the event, it should be automatically triggered when the approval starts in the workflow which is why I have the ".approval.inserted" at the end. Unless I understood that incorrectly. It does work that way when the event is in global scope.find_real_file.png

Noah S_
Kilo Contributor

Also the only difference between the two is the bc.afi and bc_afi for the name if that helps.

Is you notification and event are in same scope and tagged to the same table?

 

The script from where you are calling the event, can you confirm, you are not passing the suffix instead of event


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