Email Alerts text

@brandtley
This is a Data directive. A standard BPM on Alert.Update.

@WhileE
It sounds like you have a all round better solution with more control over the email information.
If you are able to post the code that would be great. It might help me and others.

Cheers

@MEP I’m not well versed with Case Management, but my understanding, is alerts are sent based on Tasks added, updated and deleted on cases, correct?

@MEP Here is a sanitized routine to get you started of what I send on a DD for case tasks.

Email Alert on HDCase Task sample.cs (3.7 KB)
EDIT: Code was reuploaded after I found it had a bad if condition not properly removed.

2 Likes

Nice Greg!

As requested, this is a screen shot of the data directive I use to create an email message:

2 Likes

Thanks for the replies.

@brandtley - I assume that in the BPM workflow designer you are replacing the ‘send email’ with ‘execute custom code’?
I have been looking at your code and have tweaked it to suit my needs, but I am not an expert here. I am getting an error with part of the code and am not sure how to fix it.

image

any ideas?

In Kinetic, tt tables were replaced with datasets.

uBAQ BPM - Custom Code Help - ERP 10 - Epicor User Help Forum (epiusers.help)

1 Like

@MEP did you mean to reply to @WhileE? I can’t seem to think of a way you could link AlertQue to Task. What if you triggered based on something else using a Method Directive? It would give you a lot more information to work with. What different actions in Case Entry are triggering alerts?

@MEP That looks like my code and it is on a Standard Data Directive of the Task table.

@Mark_Wonsil I went to our 2021.2.10 assuming I would see that the ttTask had been changed to ds.Task as most of my routines had been converted, but it was still ttTask. :man_shrugging:

image

1 Like

Apologies, the code belonged to @gpayne
Looks like I got confused :smile:. Let’s start again.

I need to send an email alert when a task is created on Case entry. Sending it to the email the task is assigned to.

Originally I was using the global alert (1390) to send the alert to the Alert Que, then using a Data Directive BPM on the alert Que to send an email to the assigned person.

The problem is the limited information available in the alert que to be used in the email.

It looks like the suggestion is to scrap the global alert and instead use a BPM directly on the Task table. I looked at the available methods, but couldn’t decide on which one.
@gpayne is suggesting a data directive.

I added a standard BPM to the task table. Set a condition that triggers when a row is added to the task table. Then linked the true output of the condition to an execute custom code.
I then copied in Greg’s code, carefully adjusted it (I mean butchered it :slight_smile: )
Saved and enabled the BPM. Tested it and…nothing!

I must have something wrong. Most likely I ruined some perfectly good code. Sorry!

Does it sound like I am on the right track or not?

Thanks for your patience.

@MEP It is a place to start. The Log.WriteEntrys will write to the Appserver Event Viewer and the serverlog if you have that on. The code checks for added so you don’t need a condition.
The event viewer should at least show the starting and ending lines if the routine fired at all.

Looking at the code I uploaded it appears I pre-butchered it taking out some odd conditions we have. Here is code that should fire after you change just the email addresses and user to your user.
Email Alert on HDCase Task sample.cs (3.7 KB)

Hey Greg,

I appreciate you helping me, I know it’s a struggle.

Thank you for the amended code. I have installed it on the task table. A data directive with a standard BPM to execute custom code.
I have emended your code to use my own email addresses, but not adjusted anything else until I can get it working.
I have enabled the BPM and tested by adding a new case entry which creates a new task. I can see the task is enable and exists in the task list, but there is no email alert.

I have enabled tracing and reviewed the log, but cannot see any reference to the BPM.

I guess I still have something wrong. Where should I see the log entry, as I seem to not know?

Thanks

@MEP No worries this is how we learn. Does the task have send alert create checked?

image
Standard DD on Task
image

These are the event viewer lines generated if the email is sent. You should at least get Starting and Ending if it fires at all.
image
image
image
image
image

1 Like

@gpayne Thanks

Yes the task has the send alert create checked

image
image

As for the event log. I had assumed I would see this in the windows event viewer, but I cannot find any mention of IceAppServer anywhere.
Am I looking in the wrong place?

If I enable the tracing, I can find one entry that says bpm = 1 suggesting that it is firing maybe?

Have you thought about using functions to let people know what they need to do and what they should have done but not yet completed?

You can create a BAQ that shows all outstanding tasks and the email address of the person who should have completed them, then create a function (with custom code) to execute the BAQ and then email the results to the appropriate users as a table

This function can then be scheduled to run periodically through the day to give them a list of things to do

Alternatively…have you looked @ Information Worker where tasks can appear in peoples Outlook Calendar/Task list

Just a few suggestions to solve a common problem that I come across with clients

@MEP Unless they are hidden somehow they are under the Application and Services sections

image

@gpayne I don’t have any Epicor listed there

image

Is it because we are cloud hosted maybe?

I don’t know anything about cloud services, but can you see the server log if it was turned on. There has to be some way to debug there.

If you have a trace on and it is logging everything will this utility help?