Recommended Scripting Language for working with Epicor DLLs

Hello,

We have several custom programs that were created in Visual Studio that reference the DLLs in the Epicor client folder to automate processes while going through the standard BO Methods.

While they work well, I would like to move away from complied executables and move to a scripting language instead. I feel this is a better approach for us because it does not have the overhead of needing Visual Studio, it is quicker to review existing code and make modifications, and would be easier for someone else to pick up and quickly see how it works. I’m sure there are counter arguments an cons to this approach but I believe it fits out need better.

I wanted to see if there are any recommended scripting languages that meet this requirement. In the past a consultant created something like this in IronPython, which after reviewing their script it seemed to be a good choice but I figured I would ask first.

I know I specifically mentioned working with Epicor client DLLs and I’m sure we can achieve the same goals with the REST APIs but even in that case, I would still want to use a scripting language.

Thanks all!

The important thing here is that you’re choosing REST over the DLLs. This will make upgrading so much easier.

By scripting language, do you mean web apps or actually running code locally on workstations without a browser? Are you trying to avoid having to have to install the program at every workstation?

In either case, TypeScript/JavaScript or TypeScript’s older brother, C#, using ASP.Net Core with Blazor would work too. There’s a huge workforce out there to pick from within these two languages.

1 Like

Calling into Epicor DLLs is extremely dangerous. At a previous company, I discovered this comedy of errors:

Someone designed a REST client generator that could only call into Erp.BO.* and Ice.* APIs. When an ecommerce integration needed to post deposits, instead of expanding the capabilities of the REST client generator to access the relevant endpoints, they decided to call directly into an Epicor DLL. This required installing Epicor on the server running the integration, and the integration would crash if its Epicor client was out of date. The entry point they chose in the DLL was below the logic that enforces the number of decimal places in the company configuration. The integration then grabbed the wrong field from the ecom REST API, taking the exact total instead of the rounded total passed to the payment gateway. This forced deposits with unlimited decimal places into an Epicor system configured for two. This corrupted the customer account balances, so Epicor could no longer do math properly on any subsequent transactions for affected customers. This resulted in customers carrying balances of fractional cents. But although Epicor displayed the balances in whole cents, you couldn’t get rid of those balances by posting whole cents.

I stopped any more customers from getting corrupted, but I was scared to try to fix the transaction history. So every month, accounting would have me go in and clear out customer balances with fractional cents using a direct SQL update.

3 Likes

Thanks Mark.
I decided to go the REST API route.
As for scripting language, I’ll have to install something on the clients/servers that it needs to run with so I can’t get around that.

The idea was to have an option where the script could be written in a lightweight IDE or even in notepad++. I don’t see us going the way of webapps. I will take a look at those two options
Thank you.

3 Likes

Have you checked out Visual Studio Code?

This is why I mentioned Blazor. It is really gaining steam and looks like we’ll be able to write both web and desktop apps with it.

The main reason I lean toward the web app though is I prefer not to have to go to each machine to load/update software - both runtime and applications. And from a security perspective, it’s one less option for the bad guys to use against me.

But do check out VS Code if you haven’t.

1 Like

Thank again Mark.
I am looking at VC Code now.
If you don’t mind, I have a couple of quick questions and then I’ll dig into the details.
Does VS Code result in the scripting language scenario that I outlined of does it result in a compile exe or both?
I like the pros that you listed with webapps but it we don’t go that path do you need to install any components on a client/server to run what I create?

It’s Notepad++ but has many optional extensions - including IronPython I discovered but standard Python too. If there’s a command line to do a build then it can do that. That’s what it does for C# programs.

Nope. It would just edit Python files and if you defined a build process then it could do that.

It does debugging in some languages. Pretty sure Python is one of them.

1 Like

Thought I’d mention another thing to reassure you that REST is the way to go, especially if you’re using virtual servers. My REST integrations were .NET Core Windows services and had memory footprints around 250 MB or less. Calling an Epicor DLL instantly bloats your integration’s memory usage to 1 GB, and sometimes hits 4 GB for reasons unknown, like Epicor randomly decides it’s time to do something that requires it to load a bunch of other stuff.

1 Like

When you say automated what are these triggered by? If they are timed based and internal I would use EFX over REST. You can always expose them via REST later if you like. Or depending on what you are doing you still might want to do a combo of both.

2 Likes

I use Node JS, coded in VS Code, using Epicor’s REST API.

It doesn’t get much simpler.

1 Like

As @jgiese.wci said, Epicor functions are worth considering. They are the intended location for custom business logic / processing.

  • They are stored in the Epicor database so the source is not going to be lost over time.
  • They can be called by the Epicor client, triggered by BPM, called externally via a REST call or set on a schedule to trigger on a regular basis. You dont need any additional components on the server.
  • All Epicor technical consultants will be able to pickup a function and work with it. If you have TypeScript/Python/JavaScript/C# you will need to find a developer to maintain it. (And you WILL need to maintain it)
  • If you use the widgets in the function then they are upgraded with Epicor as part of the upgrade process & they are easier for non developers to create and maintain.
  • No requirement for Visual Studio

The downside of functions is running them for testing. There is no test button in the UI to trigger the function. I use PostMan for this purpose and once setup is easy enough.

If you describe some of the automation you are thinking off we can offer more advice tailored to your specific scenarios.

Cheers
Brett

3 Likes

Hi All,

Thanks for all the feedback and suggestions. It’s been very helpful.