Epicor Functions - Calling FunctionA from FunctionB

Hi,

I have 2 functions in my Epicor Functions Library and I would like to know how I can call my FunctionA into my FunctionB (both functions are in the same library)?

Thank’s
Alain

Unfortunately not at this time. It doesn’t support it. It only supports calling another libraries function.

I usually create 2 libraries, sort of a frontend and backend:

  • MyLibrary
  • MyLibraryInternal
1 Like

So if MyLibrary has foo1(), foo2() and foo3(), to call foo2() from within foo1(), I need to put a copy of foo2() in MyLibraryInternal?

And if I want to call foo3() in foo2() (which is being called from foo1() ), would foo2() need to access foo3() from MyLibrary, MyInternalLibrary, or is a 3rd Library required?

Pretty much - i had a decent sized integration project that this affected in a horrible, messy way. You can do it either way you mention, it all comes down to what function needs to call what other functions.

Could you have a universal caller to call all the other functions based on the parameters passed?

Yes sir

We’re starting very much as @ hasokeric . Calls from a BPM, BAQ, etc always go to the first lib.

There are two reasons for subroutines 1) Because same logic called from multiple places, or 2) to break down an otherwise long function into managable smaller blocks. With #2, you can break a big function down into blocks by defining Func<>'s at the start of your subroutine though parameters are limited (I dont think you can pass by ref for example). Not perfect, but better than one routine of 100+ lines in it.

Also bear in mind that a CAB file can only have 1 functions library in it.

Rumor has it Epicor 11.1.100 has Function-to-Function within the same library

4 Likes