cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the user's department by .net portal sdk?

Former Member
0 Kudos

Hi ,all

I use the .net portal sdk to create some iViews in portal now. I can use this code to get user name:

" this.Label1.Text = this.User.Identity.Name "

But I don't know how to get the department of the user.

how to do ?thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You need to use the UserManagment service.

See <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/dotnet/pdk%20for%20.net/developer's%20Guide%20PDK%202.0%20for%20.NET/Programming%20with%20PDK%20for%20.NET/Working%20with%20Portal%20Components%20and%20Services/Accessing%20Portal%20Services.htm">this</a> on how to use services in the PDK.

So the create a UserManagment object, and use the GetUser method to get the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/dotnet/pdk%20for%20.net/developer's%20Guide%20PDK%202.0%20for%20.NET/Reference/SAP.Portal.Services.UserManagement.UserInfo.html">UserInfo</a> object of this user. This has a "Department" property.

Regards,

Ofer

Message was edited by: Ofer Feldman

Answers (0)