I have a function with input and ouput parameters. This is a ‘custom code’ type Function.
I have dropped it into a Part Std directive for testing, hooked up the parameters with BPM internal variables. CHange part ‘search word’, test my Function.
All is fine until I get to a certain ‘number’ of inputs.
Let’s say that I have 7 Function inputs of various types, string,decimal,etc.
Everything works fine.
When I revise the Function and add 1 more ‘input parameter’, revise the Dat-Directive hook-ups,
I get the error:
Index was outside the bounds of the array.
Doesn’t matter the type of the latest parameter.
It is not the code, if I comment out all of the custom code or use a ‘return’, still the same error.
Then if I take out that last parameter, everything is fine again.
I know I have not included any code or screen shots, just trying to see if anyone else experienced this.
Tuples have a limited number of items so you can only have 8 items in a tuple. (Thanks Microsoft). I haven’t had to mess with it, but I think you’ll have to make nested tuples to make it work.
Thanks Brandon, I am assuming that means: EPicor Functions ‘parameters’ are limited in number because ‘tuples’ are being used internally to hold the parameter values.
If you use the widgets, I think they internally create nested tuples to make it work. So if you aren’t writing custom code, you shouldn’t have a limit. If you are writing code to call it, you just have to use nested tuples.
I am currently not writing code to call the function, I have dropped the function widget into a standard data directive and wiring up the parameters to BPM variables, that method of using the Function doesn’t really lend itself to using anything but one-to-one variable linkups.
I appreciate the heads up Brandon and I’ll adjust my parameters accordingly.
I am a bit surprised that this limitation has not been mentioned on anything I have seen here or in any Epicor Function docs, but I could have easily just missed it, thank you for your help.