Has anyone seen this before? I’m executing a valid function. The library is promoted, and it compiles just fine. But then it fails if called from an App, and fails when run through Schedule Epicor Function.
Steps I have tried:
demoting / promoting
demoting > change the function > save > re-promote
Export library > re-import with Force Upgrade selected
Error:
Exception executing library ‘rob-appfunctions’ function ‘GetNetWeight’:
System.InvalidOperationException: Can’t find function ‘GetNetWeight’ in ‘rob-appfunctions’ library
at Epicor.Functions.Runtime.EfxRuntimeExtensions.GetFunctionInfo(IFunctionsCatalog functionsCatalog, FunctionRefId refId, String forCompany) in C:_releases\ICE\ICE5.0.100.0\Source\Server\Customization\Epicor.Functions.Runtime\EfxRuntimeExtensions.cs:line 35
at Ice.Internal.Task.ScheduledFunction.ExecuteFunction.GetFunctionAdapter(String libraryId, String functionId) in C:_releases\ICE\ICE5.0.100.0\Source\Server\Internal\Task\ScheduledFunction\ExecuteFunction.cs:line 117
at Ice.Internal.Task.ScheduledFunction.ExecuteFunction.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:_releases\ICE\ICE5.0.100.0\Source\Server\Internal\Task\ScheduledFunction\ExecuteFunction.cs:line 52
Just tested another function in the same library, and it executed without any issue.
You have an internal flag at library and function level. When selected it stops it from being run ‘externally’ which includes the API which app studio uses.
Makes it available to BPMs, other functions and schedules.
If that works, i’ll find the case/prb for you to reference.. whee!
PRB0288709 .. now over a year old! I even ran into this error on a call with daniel @ epicor cs.. i had to find the prb and inform him to recycle the app pool on his local instance to import a function in one of my cases.
I asked him to follow up on that, since he was able to replicate it himself without even trying (we were working on an unrelated case)
My favorite line from that PRB: “This issue is not always reproducible. But it has been reported by many customers, we do not know what causes it, but we know that an app restart fixes it.”
Apologies I missed that you had already tried scheduling it.
Only other time I have seen
something like this is when the app servers got out of sync. Which an app server recycle could fix either through Epicor support or the CMP
Please open a case for it and reference the PRB, you never know, it might get somewhere everyone else’s didn’t! So far, I’ve only run into the issue on my environment twice in 6 months, fingers crossed it doesnt happen again.
It’s much more insidious if you are editing an existing function, because it saves without error, it will just execute the old code. so you’ll be pulling your hair out for a while before you make it change some logging output and realize nothing is taking effect. quite fun!