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

OlaN
Giga Sage
Giga Sage

Hi,

You might be able to modify the OOB Flow that handles updates to the Customer Case.

Make a duplicate of that flow, then inactivate the OOB one, and in your custom one, insert an extra step to send an email to the Agent, and activate your copied/customized Flow.

Hey OlaN,

 

Are you suggesting to use the OOTB flow in a global scope? I thought about it but it seems like i'm running out of the best practices since the original design was inside the Customer Service Scope.

No, not necessarily.

When copying the OOB Flow, you decide what scope the copy should be stored in. You can use the same scope as the OOB one, to have them both in the same scope.

 

find_real_file.png