I am embarrassed to say I still havenāt learned functions in Epicor yet. It is funny because I am used to building functions in other languages. I just havenāt bothered for Epicor. It seems like a lot of steps, but all the stuff you post looks super useful. I should really figure it out.
Iām waiting for functions to improve. Not being able to even LOOK at the design after promoting is obnoxious, and also not be able to test them without building something to call it is frustrating.
Honestly, if you know how to do BPMs, youāre most of the way to functions. There is a lot of shared experience there.
There is a lot of good things about functions: promoting code reuse, moving logic to the server, and exposing code via REST are very powerful benefits.
But yes, the implementation choices are sus. I imagine that a lot of choices were not based on good API management practices but on the needs of the Epicor partner community.
In the API world, it is not only possible but preferred to have both the production and staging versions active at the same time. Instead of dropping everyone into the new version, they do a staged rollout with people in certain groups getting the new version to field test while the other users remain in the previous version. Once, good, everyone is moved to the new slot and the other slot becomes available for the next version.
Kinetic has had part of a Feature Flag system but does not have that tooling built into the user-development tools. One could do alot with that capability without the promotion/demotion feature.
And yes, yes, yes. The developer experience could use a lot of DevOps: source control, observability, testing, etc. These features would be good for the partner community as well as the user developers out here.
Hereās a good thing to note, if you are not calling from REST, your functions are usable whether
they are promoted or not.
I feel your pain, but to be fair, most of them are called from something else, so Iām
not sure if there is a good way to make that happen.
What I do for standalone functions, is keep the schedule epicor function screen open,
and use that to āSubmit Nowā.
Iām not sure if this is still valid, but you can test staged functions as well via rest.
https://TLD/SDK41/api/v2/efx/staging/C001/CostFunctions/GeneratePOEstRevenue
Still true. At one point, the staging went away when promoted and vice versa. I may need to check that againā¦
Its not really that helpful. I want to be able to test the function without going anywhere else. For example, if you create a BAQ with parameters, you can test it right there without going anywhere - it just asks you to enter the parameters and then shows you the results.
Have you tried that ? I wish it was in the same screen, but it does let you enter the arguments in.
Not perfect by any means, but I find it useful.
Maybe we should build a function tester toolā¦
Not trying to start another fire, but I do have an idea out for that.
I know! I commented on it because I donāt have any votes
You mean postman?
Yes its better than nothing, but I still find myself avoiding functions - 99% of what I need to do CAN be done in a BPM so there isnāt really any incentive to move.
If my threads donāt end up on fire, I am disappointed.
I was like that not long ago, but Iām starting to see uses.
I havenāt found anything I couldnāt do with a UBAQ, but found many things a function
made simpler.
In all seriousness, if you use the variables functionality in postman, you can set up all of your stuff for a template, and even a quick switcher for environments. We have a team so we can all build in the same library, but to make a new one, you make a new call, copy a call from any other function, change the library and function on the URL, pop in a standard set of headers (2 clicks) then build your Json Body. It sounds like a lot of steps, but you can hold your logins, API keys, and all the env variables to move around seamlessly.
I would still prefer it to be in the function screen. But once you get through the initial set up in postman, itās pretty slick.
We used to use Ubaq as functions, cause yeah, you can always call a ubaq. Functions just use the part you actually want.
You donāt really need indoor plumbing either. But it make like a hell of a lot better. lol
Donāt do it yet, but when weāre done yacking, I want this thread split.
We can split it at @NateS 's first post and add an intro.
Sorry I didnāt mean to derail your thread, your function is awesome.