Calling an EFx from C# code in another function?

I know I’ve seen this, but can’t currently find it.

I have a function that gets these inputs and outputs in the signature:

It works great when called from a widget. But danged if I can figure out how to call it from inside a C# code block.

Where I need to read it is inside an Action called from inside another loop.

I’ve tried all the things that ChatGPT has helpfully suggested with various errors.

Here’s one:

image

I’ve tried putting the Func part at the top of the code and calling from inside the loop. Et and cetera.

Anyone have some simple code they’d be willing to share?

Thanks,

Joe

An Epicor function and a C# func are not the same thing.

Calling a function from C# is a little different depending on where you are calling it from. Is this a BPM or another function?

This is a current example of calling a different function in the same library as the function I’m calling it from.
image

    // Call Function for Quantity Adjustment
      {
          this.ThisLib.QtyAdj(localCompany, localPartNum, localOffcutInches, localKeyOne, localPartChkBoxName);
      }
    }

The variables being listed are in the function that you are calling from to fill in the values the other one is expecting in in Inputs.

Edit:
I should clarify that I suppose as upon rereading it it is poorly written.

QtyAdj is the name of the function I am calling, it lives in the same library so it is ThisLib, I have not called across libraries but I assume if your library had access to another library in it’s security tab you could replace that with the name of the other library. The brackets are a listing of what I want to pass from the current, calling function, to the function that is being called, in the order that the Signature has them for inputs.

1 Like

This is an example I just did where I’m calling a function in a different library from a function.

Thanks for your invaluable help, folks!

This seems to work:

// get ack (poNum, inAllStatuses, inUseTestData, inDoNotMarkProcesses, inSkipProcessedCheck)
var (outDiag, outRes, outRec) = this.ThisLib.GetAck(poNum.ToString(), false, false, true, true);

2 Likes