How to Enable and Disable User Account by Epicor Function

indigenous native american GIF

:rofl:

3 Likes

Can someone explain why BeforeImage is required on some services, but not with others? Seems totally random

It’s how Epicor, or (YOU) determine if a field has changed.

You can get away with it, if Epicor isn’t checking, or if you aren’t checking conditions in a bpm.

In this case, I don’t have any BPMs checking, but the base obviously must be checking.

@josecgomez has a larger write up on it, let me see if I can find it.

2 Likes
3 Likes

So the safest way is to always add those 3 lines of code to do the BufferCopy. Is this something we should be doing? I guess we’re lazy and omit this step until it bites us.

That’s exactly what happens lol.

We just had a discussion on getting bit a few days ago.

Not sure which specific code you are referring to, so not exactly sure, but as a general idea, yes, I believe all the things should have a BeforeImage.

I have something similar to this in a function template library somewhere for our other devs to copy.

Thanks for the links. Now at least I know why

3 Likes

Thank you Kevin.

I was going crazy. I have a function that adds and sets users so I copied it down and stripped it down to just change UserDisabled and RowMod and it would throw generic object errors. This fixed it. Same code now but I buffer add a row before I do so and it just works now :smiley:

Ha I didn’t have to do it with disabling employees.

Making a tool to quickly onboard and offboard users and employees.
The onboarding one is functional, just need to test all the case combinations then on to offboarding.

1 Like

So does your onboarding process use the new copy user?

I had no idea there was such a function. Thanks for bringing it up. I took a quick peek to see how it works. On investigation I do not use the copy user BO.

My screen goes a bit further. It will set up the user, their system access, groups and work forces.

If you specify employee options it will also set up an employee, their access and their resource in a resource group - warehouses etc.

The next and last piece I will be adding is a buyer component to set up their purchasing access and approver (if needed).

I did a trial run of what I have so far and it set up the user, their workforces, employee and resource in a few seconds from picking a few options (Department, Manager, are they a machine operator etc).

When I tried Epicors Copy user it was slow, did not do as much and glitched out. I had to restart the user screen to see if it worked which it did but it did a lot less than what I am building.

The other module that I am trialing now is offboarding. I can deactivate a user.