Scheduled Task no-fire in TEST

,

This has got to be a common occurrence and I wonder how others have addressed this.

We have a LIVE environment and a TEST environment that are basically identical. We will occasionally copy the SQL DB from LIVE to TEST as needed and then do our Epicor customization testing there.

We have several BAQ Reports scheduled via Epicor Task Agent that trigger every morning and send an email. That part is all good for LIVE.

The issue is that some of these are triggering twice, once in LIVE like they should and then again in TEST when they shouldn’t. End users don’t know whether the email is coming from TEST or LIVE.

Is there a way that I can programmatically tell my BAQ reports to only send when executing from the LIVE database? Or am I stuck just deleting all of these scheduled reports every time that we copy over to TEST? How are others approaching this?

We use the “IsLive” field for BPMs to make sure they only fire when it’s actually live, or to go down a different path for test. (like changing the email from to TESTemail@yourcompany.com etc). I’m sure you could figure out something like that for the BAQs so that they don’t return anything.

That field is on the SysCompany table I believe.

If you are on Prem, we have a script for the test environments that changes a bunch of stuff, like them colors, and is live, and schedules, and other random crap. Then we just run this right after the restore and before we turn the app servers back on.

This has come up quite a bit lately. Short answer is yes.

That’s not foolproof unfortunately.

I remember seeing “Is Live” somewhere in the Epicor interface but I can’t seem to locate it now. Where is that checkbox? Or you just doing it via script?

I missed that part.

Well, if your cloud, you don’t have that kind of control I guess @klincecum . On prem, that’s us to us to flip that flag, and we do.

Brandon, would you be willing to share that script? That sounds like a great idea to include color changes, and I’m sure a lot of others here could use the same.

On thing to think about. When data gets refreshed in the Pilot from Live. I go into the Pilot DB and change the company name from Acme Company to Acme -Pilot- 06-13-23. When designing reports I always display the company name at the top. Now you will always know where the report came from.

1 Like

We do, I was going to point it out, then re-read your reply.

It’s here.

We do it via the script though.

hmmm… maybe, I’d have to look at it closer to see how useful it would be. There’s a lot of stuff that specific to us that wouldn’t be of any help to you.

1 Like

I have a function that is basically this:

bool isProduction = !Session.AppServerURL.ToLower().Contains("pilot");

It’s slightly more complicated as I have 4 environments, but you get the gist.

We use GitHub - mailhog/MailHog: Web and API based SMTP testing and I think we just change the smtp server and instead of testing ever going to someone’s email, Mailhog has an email ui you can see all captured emails.

That would be my recommendation. Post Copy change your SMTP and you can still compare apples to apples.

All developers can read the emails, you can see headers, attachments etc… But we also stop Reports by clearing the report schedules in DEV… but even if we didnt, we would be safe and devs and BSAs can compare if things are working, without having to change user emails or trying to check which environment it is.

1 Like

Oooo, I like this a LOT better. Just change the SMTP server, that’s super easy!! Simply putting in an invalid mail server would shut it all down and be good enough for us, but the MailHog thing is a really clever addition. It would definitely be helpful to see ALL emails that are being triggered in TEST. Thanks @hkeric.wci!

Makes it easy to roleplay “PO Approval” (not that kind of roleplay @klincecum) where 2-3 parties need to click or do something and seeing the email flow.

1 Like

Ryan Reynolds Insult GIF by The Hitman's Wife's Bodyguard

Yeah, that’s exactly what I was thinking. We were doing EXACTLY that just 2 weeks ago.

For anyone curious about using MailHog for this, it couldn’t be easier. Steps are:

  1. launch MailHog executable on Epicor server (no install or config required)
  2. configure Company Maintenance with these options for SMTP
  3. go to MailHog web interface in browser and explore messages

2 Likes

I know it’s marked “solved”, but what my process after restoring the Test DB from the Live is to disable all of the schedules in System Agent Maintenance of the Test environment before I re-enable the Task Agent.

1 Like

We have moved from MailGun to MailPit. Just more recent development activity and dark mode support etc. It might even be a fork of MailGun.

2 Likes