Function and Function Library become read-only?

Looks like I need to put in a ticket, I was not aware of this- I did not ‘export’ the library, I used a solution.
I’ll bet as time goes on I won’t be the only user in this pickle.

There has got to be a way for me to access my code , I’ll see what tech Support can do.

For this time why not restore the DB to before the refresh temporarily, grab the code, and then go clean again? I wouldn’t bet on that support can get you your code back.

1 Like

Thanks Josh,
Great idea, I’ll see what’s what…

1 Like

idk, @SAD knows better

Feeling pretty strong about this idea:

“Logs and source code should not be stored in the database.”

I don’t know how many times people get burned by this.

2 Likes

@fuji36 this works in an emergency if you have no other way to get your code…At ALL , ALL OPTIONS Have been exhausted, the world is on fire, and the fate of humanity depends on this code… IF AND ONLY If the Above is True.

DISCLAIMER
DO NOT RUN THIS IN YOUR PRODUCTION ENVIRONMENT… SERIOUSLY…

UPDATE ecf.efxlibrary
SET    mode = 0,
       ownedbycompany = 'EPIC03',
       owner = 'epicor',
       package = NULL,
       packageversion = NULL,
       publisher = NULL,
       published = 0
WHERE  libraryid = 'TEST2' 

Update your information as appropriate.

Then you go in there you copy paste your code / save it. Then you delete the library and start over. Don’t use this hacked one just use this to get your code out.

ME, MYSELF, I , OR ANYONE ELSE IN THIS THREAD OR FORUM ARE NOT RESPONSIBLE FOR YOU BREAKING YOUR SHIZ!

5 Likes

Direct SQL gasp! For shame @josecgomez for… shame…
image

1 Like

I am currently paralyzed with fear! Thanks Jose, I will discuss w/ my partner who handle all things DB/SQL.

2 Likes

Success- thanks again Jose - there were a couple of other columns to ‘tweak’ in order to free up the functions ‘design’ button: ‘Published’, ‘Private’ both false

Cool publish was already accounted for in the query above and private didn’t show up in mine good to know!

however I believe Private is just for Internal Only Checkbox that shouldn’t matter, either way awesome!

yeah it was in yours I see now, appreciate the help

1 Like

That’s all well and good, however, how about those using widgets?
Surely, there needs to be a way to at least view the function details.

Surely, there is. Source code belongs in a source control system with documentation about what the code does and how to install it in a repeatable, consistent, and reliable method - preferably automated. It’s a mind set that is popular with freshly-branded coders. Hell, you can’t get an interview as a coder without a public code repository. Developers aren’t allowed to publish to production. They create their artifacts and start an automated process to install them.

My point is, there are times Epicor should change but, just maybe, there are times we need to change. :man_shrugging:

1 Like

Assuming there is only ONE single methodology that everyone uses, or trying to enforce it, is counter productive. I understand WHY Epicor did it that way. It’s for their cloud environments. It’s just about restricting users from entering code in cloud environments. Not against it, but there should be a switch that can be set in the config to disable this behavior in on-premise installations. Development environments get refreshed every few months.

Also, I have asked multiple times for Epicor to add some events I can hook in to actually be able to use proper version control. Still no plans for it apparently…

Just one more reason to never use Epicor Functions, honestly… Can’t call functions in the same library, can’t call functions from client code without littering it with usernames and passwords, and now can’t include them in solutions, which we use to publish EVERYTHING ELSE. The more I look into Efx, the more I understand it’s a half baked solution.

I understand why they did it, but I don’t agree that “this is the way”. It’s at best a poorly thought out implementation issue.

1 Like

That’s all well and good, but it was Epicor’s idea in the first place to store ALL their code in the database…

You can do this in client code without user names and passwords by using the RestClient helper that is built in to Epicor 10.2.700+ it uses your current session to make the calls.

2 Likes

Awesome, do you have an example of its usage documented somewhere?

Sure thing! Its in the Epicor Help

1 Like

While we’re on the topic of source control…
For BPM’s, you can see the history in the server->BPM folder. Where are the sources for these functions stored?

1 Like

I wonder when this made it in, been asking for months in preview program meetings for a BO or something to be able to do this… Thanks!

1 Like