I am trying to use Web Services in NAV to access the User Card page. I have successfully set up the Web Service and have been able to call it from my application. I can read users, update users and delete users...however, when i try to use the .Create(ref newUser) method I get an error and can't figure out how to create a new user.
Here is the error:
User Name must have a value in User: User Security ID={6A9F7C77-13D6-43CA-A9F9-FDE1498584E7}. It cannot be zero or empty.
It doesn't matter what values I set in the User, including User_Name...I always get this message.
Any advice?
0
Comments
nice work!
Can you explain more about your user creation?
Maybe this helps...
In NAV page users (9800) you can see that it will create a guid for every new user as User Security ID. This is the primary key ... see table User (2000000120)
You should do the same.
In C# you can use fill this guid with the User Security ID!
You can get the SID for your user with "DirectorySearcher" or NAV Assembly "Microsoft.Dynamics.Nav.NavUserAccount"
Came
*Update*
Hi,
so now i have written my own C# Application to check your issue.
I have the same one.
Always if I want to create a new NAV User i get your error message.
But I have a solution!
When you look at Page 9800 "Users" -Trigger OnInsertRecord :
Change the code to:
Works great for me.
This will not effect NAV Standard.
But my problem is... how validate the input data?