Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Rename User windows name in Navision & Rename his Sales Person code

Posted on by 460

Due to the fact that some users in our company get married or they get divorce they have to change their names. Generally, I know how to do this in Navision but its not that easy.

Problem is when I try to rename the windows name it takes like forever and many users in our company will be blocked during the operation. I also tried to do it after working times and still it took like for ever.

I am sure there is a better way to do this? any ideas?

Ps: We update our NAV system at the beginning of this year to NAV_2016. 

*This post is locked for comments

  • RE: Rename User windows name in Navision & Rename his Sales Person code

    You are Welcome :)

    Allah Akram :)

  • Suggested answer
    Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: Rename User windows name in Navision & Rename his Sales Person code

    Hi,

    Can't you login in NAV through the admin account and change the names manually.

    If for some reason you want to automate the process you need to follow few procedure

    1. Create the a table that maps OldUserName to NewUsername say MyUserMappingTable.

    2. Write the code to modify the current username with the help of UserMappingTable.

    Code:

    MyUserMappingTable.RESET;

    IF MyUserMappingTable.FINDSET THEN

    REPEAT

     UserTable.RESET;

     UserTable.SETRANGE("User Name",MyUserMappingTable.OldUsername);

     IF UserTable.FINDFIRST THEN BEGIN

      UserTable.RENAME(UserTable."User Security ID",MyUserMappingTable.NewUsername);

     END;

    UNTIL MyUserMappingTable.NEXT=0;

    Note: Use this code method only when there is a single login such as admin.

    If no one can login into the NAV then you might have to either delete the data from User,User Personalization and Access Control via SQL query

    USE [Database Name];

    delete from [dbo].[User]

    delete from [dbo].[User Property]

    delete from [dbo].[Access Control]

  • M.Zayed Profile Picture
    M.Zayed 460 on at
    RE: Rename User windows name in Navision & Rename his Sales Person code

    Thanks Rahman :)

    I was looking for something like ;)

    Ramadan Kareem

  • Verified answer
    RE: Rename User windows name in Navision & Rename his Sales Person code

    SQLSearchstringProc.rar

    I have a good trick:

    You can use the attached script, to look for specific strings inside the database itself, this means, you can look for the old name as a sting all over the database.

    Once you know where exactly, you can develop another script just to replace it, once you test this couple of times, you can have this job even automated, this is how we usually deal with the subjects Related to user naming in NAV DBs.

    Rahman

  • M.Zayed Profile Picture
    M.Zayed 460 on at
    RE: Rename User windows name in Navision & Rename his Sales Person code

    Hi,

    Our IT change the name in the Active directory. So, now the active directory account in Navision is also changed!

    Problem is even when the active directory account is renamed! still the username in Navision still need to be renamed manually.

    For example, i need now to change the user name lets say in Active directory it is Domain\MZAYED & User name is Domian\MTELL. I need to change the Domain\MTELL to Domian\MZAYED.

    We donot want to create a new Active directory account we want to use the old one. Thats why our IT department rename the active directory account. due to this action the windows user name have to be changed in Navision.

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Rename User windows name in Navision & Rename his Sales Person code

    What do you mean by renaming? The full name can be renamed when you want without blocking. Instead, if you mean to change the Windows login, you've to re-create the login in Active Directory and then re-create the user in NAV.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans