How do you ENABLE a new user via EFx

Trying to make good on a promise, and I am working on an app to create new users.

I have successfully made an Epicor Function to create the user and add a company and sites to the user. That part works fine.

Last step is to enable that user. Why is this so hard?

In the EAC wizard, it’s a simple checkbox.

In the client, it’s a button that asks what email and then it emails the temp password (I don’t think the EAC does this).

What am I missing?

I tried setting all this:

And then in the middle there’s a method for AllowBlankPassword, which I threw in there also (it returns false).

So… do I also need to generate a temp password?

I feel like there should be a whole method for enabling a user and I am missing it.

I’m also surprised to not find anything on this site yet.

1 Like

Did you try assigning UserDisabled = false and then calling the update method? :thinking:

Indeed, I did.

And in User Account Security, the user was still disabled?

Yes.

I mean when Postman says “Something went wrong,” I don’t expect it to have worked lol.

Maybe I should have started there. But it’s not much of an error.

Can you make your callm in SWAGGER?

What does your call look like in REST / JSON

Anything in the Event Log?

Here’s a trace in the DMT, which works and does not send an email (a la the EAC):

Right. It’s just setting UserDisabled to false. The UI’s also call ResetPassword just to be friendly.

Are you setting the RowMod to “U”?

And I see the PwdChangeRequstOn date there too. Setting that?

Yes, I tried that in UserFile, UserComp, both and neither.

Oddly, the trace only shows it set in UserComp – why? UserFile holds the field!

This guy?

Functions don’t seem to load there.

Maybe you mean just calling the Update method here, without a Function?

I’d try without the function first. This guy:

Like in Postman?

image

OK, standby (or don’t).

I patched https://host/server/api/v2/odata/COMP/Ice.BO.UserFileSvc/UserFiles(‘wcambell’) with just below and it works fine

{
  "UserDisabled": false,
  "RowMod": "U"
}

Does PATCH use UpdateExt?

Yes

Works for me too…

Worked using

  • GetByID
  • Update RowMod to U on Unchanged Rows
  • Update DisabledUser to !row.DisabledUser (so I can toggle) on Changed Rows
  • Update

1 Like

OMG. Josh is showing widgets to Jason who posted code.

:exploding_head:

Ha, well 2 things

  1. I sure wasn’t going to say anything
  2. I posted a trace, not code… Does Postman count? (I say no)