Trigger event by Scoped Flow

Vinicius Luz1
Tera Expert

Hello Guys,

I have a requirement to send a notification to the Agent every time a case[sn_customerservice_case] has a new received email.

My first tentative was building a Inbound Action calling an event and sending an email notification triggered by event. - It didn't work cause the [sn_customerservice_case] has already an "inbound e-mail flow" to get updates and replies and attach to the case record. So this flow was making my inbound Action to be bypassed.

Then I tried putting the code to call the event inside this flow as you can see:

find_real_file.png

 

find_real_file.png

 

Well, the idea sounded good but it seems like it's not working because the flow it's in a scoped application "Customer Service", I came into this conclusion because the code actually works fine when I run it in the background script.

I couldn't even use the OOTB Flow Action "Create Record" to create a new record in the [sysevent] table because the scoped flow is not allowed to access this core table.

Any Good Ideas on how to solve it? Any guidance?

1 ACCEPTED SOLUTION

You do not need Ajax call as it is serverside script

You will have to call something like

 

var objCaseUtils = new global.CaseUtils();

objCaseUtils.NewActivityEventCall(caseSysID);

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

View solution in original post

7 REPLIES 7

vkachineni
Kilo Sage
Kilo Sage

As a workaround:

Can you move lines 5 thru 9 to a new script include function in global scope accessible to all scopes.

Call the script include function from the action script step.

May not be the best practice.

 

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Hey,

 

Thanks for commenting, as you can see on line 11 on, I did try it. 

There's another error "Error MessageAbstractAjaxProcessor undefined, maybe missing global qualifier" appearing in this case

You do not need Ajax call as it is serverside script

You will have to call something like

 

var objCaseUtils = new global.CaseUtils();

objCaseUtils.NewActivityEventCall(caseSysID);

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Oh, I see.

Thanks a lot man, it worked good.