Skip to main content

Notifications

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.

 

  • Martin Dráb Profile Picture
    234,031 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.

  • 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.

  • Verified answer
    Martin Dráb Profile Picture
    234,031 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 .

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans