FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



System User IDExpand / Collapse
Message
Posted 1/19/2007 6:02:14 AMPost #1046
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
Hi guys,

I'm currently having problems in retrieving the System User ID of the logged in user in CRM. I need to retrieve that one in order to proceed in using the web services by CRM. I'm using every bit of code in the SDK (like the WhoAmI method) but unfortunately i still cannot retrieve the user id of the current user. My problem is focused on the MENU, because i created a MENU beside all the other default menus by CRM. and when i click that menu, i am opening my own page, an aspx page that will run the web service by CRM. That is where i am having my problems of not retrieving the USER ID mainly its a GUID. Guys, please help me on these.

Thanks in advance...

Posted 1/19/2007 8:23:22 AMPost #1048
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
Assuming that your page derives from one of the c360 SDK pages, it is very easy to get information about the current user.

systemuser crmUser = Instance.CurrentUser.User;

This gives you a reference to an CRM system user object and you can get all the information you need such as the GUID which is what you asked for. However, if you are going to make web service calls to CRM, the user credentials are even more necessary than the user ID. You can get the credentials like so:

ICredentials userCredentials = Instance.CurrentUser.UserCredentials;

This is all documented in chapter 7 of the training guide.

 

« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 8:53am

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.578. 13 queries. Compression Enabled.