web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

I need to update the UserInfo table

(1) ShareShare
ReportReport
Posted on by 5

We're attempting to create a Job in a workspace in order to update the enable field status of all rows in the UserInfo table, since everytime we backup the production environment to UAT all users are set to disabled. In essence we are trying to run:

while select forupdate UserInfo
where UserInfo.id != curUserId()
{
  UserInfo.enable = NoYes::Yes;
  UserInfo.update();
}

However it seems that like most default tables in D365, there is no way to grant privileges to do a query like that. Is there a woraround for the isssue?

We're also getting this error:

Cannot edit a record in User Information (UserInfo). The corresponding AOS validation failed.

 

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    236,394 Most Valuable Professional on at
    RE: I need to update the UserInfo table

    The only enabled user will be the administrator and privileges don't apply to him, right? So there is no reason to assign any.

    By the way, there is a more efficient way to do the same thing:

    update_recordset userInfo
        setting Enable = NoYes::Yes;

    Nevertheless the usual approach is doing it in SQL, not in X .

  • Jouluna Profile Picture
    5 on at
    RE: I need to update the UserInfo table

    Thanks.

    Right, the query won´t work even with the admin user.

    I thought of creating a SP in sql, however it will only work in the UAT environment.

    Is there a way to access the production DB?

    It seems there is no option to access the DB from lcs, and it might cause some issues. I tried in the past to add a column to a default table in UAT and once we transferred the changes to production, the solution stopped working.

  • Martin Dráb Profile Picture
    236,394 Most Valuable Professional on at
    RE: I need to update the UserInfo table

    You can't connect to the production DB and it wouldn't help you anyway, because the users are active in Prod. They're disabled during the export, to allow admin review users, run data clean-up scripts and so on.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 857 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 548 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans