NAV 2013 Web Service User Card Create error
nboettcher
Member Posts: 14
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?
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
-
Hi,
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 useGuid.NewGuid()
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 :IF "User Name" = '' THEN ERROR(Text004,FIELDCAPTION("User Name"));
Change the code to:IF GUIALLOWED THEN //Checks whether the C/AL code is allowed to show any information on the screen IF "User Name" = '' THEN ERROR(Text004,FIELDCAPTION("User Name"));
Works great for me.
This will not effect NAV Standard.
But my problem is... how validate the input data?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions