Hello all,
I am trying to solve simple task: getting Full user name (or DisplayName) for specified USERID. You know, you have USERID of person, which posted the invoice, but you want to print his name on the invoice. Under classic client, I was using table 2000000050 Windows Object to get the name. But this table is empty under RTC.
Ok, DotNet interop is here, I can use it. But, all examples I have found on internet are failing on permissions or "path not found" error, or are complicated (getting data from AD using CN etc.- I need to know the CN...). Example I have tried to use:
Var
Name DataType Subtype Length
Domain Text 1000
Result Text 1000
PropCollection DotNet 'System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.DirectoryServices.PropertyCollection
DirEntry DotNet 'System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.DirectoryServices.DirectoryEntry
Env DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Environment
.....
Domain := 'WinNT://'+Env.UserDomainName+'/'+UserIDValue;
DirEntry := DirEntry.DirectoryEntry(Domain);
PropCollection := DirEntry.Properties;
Result := PropCollection.Item('FullName').Value;
Failing on permissions (it seems because delegation). When used "Client Side", working, but asking for permissions to use the assemblies - impossible to use in this way.
Have somone some tip how to get the full name of the user under RTC?
Answers
|To-Increase|
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Is this not sufficient? Also what is really the reason for us having UserID on reports?
/Claus
I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Lookup("Windows Object".Name WHERE (SID=FIELD(SID)))
Microsoft Dynamics NAV
Internal error 12 occurred in module 40. Contact your system administrator.
Page View - Test User Name must close.
OK
("Test User Name" is name of the page)
;-) and if the Windows Object is empty, it will not help (if the table will not be filled in when applying the filter, which doesn't work when opened in page directly...)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks for putting this post.
I am also facing the same issue while accessing the USERNAME calculated from Classic and using it into RTC.
Classic works fine. But, RTC giving the same error that you have mentioned.
Could you please, suggest me what can be the solution to get it worked into RTC Report?
Thanks.
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com
We have solved it by adding the Full name field into User Setup and letting users to fill the name here manually and we are using it in reports from there.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks for your below post.
I have few queries in this:
1) Is this method can easily be executed in 3 tier environment ?
2) Is there any permission issue can occur during execution?
3) If we have selected the DotNet variables as x64 then will it create any issues on 32 machine? or vice versa?
4) I think, this method is specific to RTC only. Not for Classic. Am I correct?
Please, suggest.
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com