For all you wild ones supporting an integration via API... what's a good standard for logging?

Maaaaaaaaybe not. I don’t really want to go adjust all of my function calls to write to UD15. :expressionless:

1 Like

RS485 Serial is your next project.

That’s why I am trying to get ideas now haha

Is it worth it to make an overloaded function, and just add it in key places?

Don’t give me any ideas! We do have a current integration that mimics telnet via send keys to extract data from one of our system so I could go that direction too… :thinking:

1 Like

youre not the boss of me GIF

Wait, shit…

Yeah, don’t give him ideas!!

So beautiful :sob:

2 Likes

Interesting. I was discussing similar issue, but capturing errors from DMT outputs with a Datadog convert. He mentioned there is free tier that they have that might be useful. We know we can send errors to the server event log, so you could consume the event log with Datadog tools or some other tool that parses windows event logs.

Might not be exactly what you are looking for, but just a suggestion a bit more outside the Epicor environment.

1 Like

Oh, I noticed. Had too much to say and not enough time to say it - until now.

I am very much a proponent of what @Dragos is doing and what @Aaron_Moreng was doing. Having that API in the middle has several benefits over direct linkage via RPC “REST”:

Enhanced Security

  • Can add another layer of security using Azure Active Directory by providing conditional access/MFA and potentially finer controls with AAD Application Roles.
  • Having a Backend for Frontend (BFF) keeps your API-KEYs hidden from the client and can use secrets managers at run-time so they are not in the code.
  • Get stronger parameter checking earlier. Filter out bad requests before hitting the ERP system. Although you could do that if you used Epicor Functions to call your Business Objects saving some cycles.

Decouple the Client

  • Makes upgrades easier if changes for all clients can be made in one piece of code
  • Add other clients (like mobile, shop displays) easier
  • If you run multiple ERP system, it would be easier to move from one to another without changing the client by using the same API for each. (See DDA below)

Protect the ERP system

  • Implement Rate Limiting
  • Secure Endpoints via Azure AD
  • Implement caching for some objects to reduce the number of calls hitting the ERP System, which would also improve performance.
  • Potentially saving some licensing for shop screen display, etc.

Improved logging

  • Log to analytic systems that have rules that can notify or even react to certain scenarios
  • Utilize Open Telemetry to observe throughout the transaction from Epicor to the various clients

Promote Domain Driven Architecture

  • Puts a facade on your internal systems (including ERP) to make them look like your business.

Easier Testing

  • APIs can mock up data so you can use automated testing on your clients without using production data or more difficult setups in a testing environment

Better Error Handling

  • Unlike DMT, APIs can react to error messages or even “fix” some common errors (formatting, cross-reference tables, etc.)
6 Likes

Best Friends GIF by Black Rifle Coffee Company

2 Likes

What are you using for the Keys (key1,key2,key3)? Anything specific?

It’s in her first picture.

Looks like her real key is a guid in key5.

1 Like

Key1 = The function name
Key2 = API direction
Key3 = HeaderKey (eg OrderNum)
Key4 = DetailKey (eg OrderLine)
Key5 = Generated GUID to maintain unique records.

Honestly… I could have just used Key1 with a GUID and the rest as named UD fields, but it evolved over time.

4 Likes

@hmwillett and @klincecum I also learned that there are SQL expressions that can parse a json value if it’s a valid JSON value…

I am doing the logging like @hmwillett suggested and it’s working well, but I keep having to copy the JSON bodys from the logging table and then re-format them in VS code… But little did I know you can use this right in the query: Work with JSON data in SQL Server - SQL Server | Microsoft Learn

1 Like

Doesn’t seem to work in a BAQ :frowning:

1 Like

That was my whole point of posting that :frowning: I was hoping someone would chime in saying they already use this in a BAQ…

You got my hopes up for nothing!

I could make it work, but I’d be breaking the Epicor Warranty rules :smiling_imp:

1 Like

I’m sorry! I thought wow this is cool! And most the time a BAQ does allow it to happen. And I believe I know which hack you’re talking about… someone named @hkeric.wci I think also knows how to make some additional functions available via BAQ as well. I don’t recall how exactly to do it but I remember something in my distant memory… very fuzzy.

I wouldn’t put anything past that guy. He seems pretty swooft.

1 Like

But I think he had mentioned it wasn’t a void in the warranty, it’s just something that they don’t publish and tell people how to do… maybe??? i think that’s what I found cool about it. But I could be recalling this incorrectly