function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MohanbabuMohanbabu 

How can get the UserName through API

Hi
 
I have a requirement to get UserName from sforce Through API.
I am unable to find the option to get UserName.
 
I can able to get userEmail,UserID,UserFullName using getUserInfo() function which will return GetUserInfoResult object
 
GetUSerInfoREsult object is not having USerName.
 
Please help me how can i get username ( i don't want to pass the username as a querystring parameter)
 
 
Thanks,
Mohan

 

SuperfellSuperfell
Use getUserInfo to get the users userId, then query the users table, select username from user where id='[the id]'
utilittechutilittech
We are using Csharp 2005.net and have the following questions:
 
1. what is the connection string for the database? 
   string strSFConn= "Provider=SQLOLEDB;server=????;uid=???;pwd=??????;database=??????"
 
2. In the select statement the name is "user" or "users" ?
 
This is very urgent for us and it would be really appreciated if somebody will reply asap.
 
Thanks!
 
SuperfellSuperfell
Its a web services API, not a database connection, I suggest you start by working through the .NET getting started guide.
utilittechutilittech

Thank you for your reply.

Unfortunately we have to get this done immediately hence we do not have a lot of time to look around to find this information.

Does anybody know how what this webservices API is ? Can anybody provide a sample code (C#) on how to use such an API to extract the username?

Thanks for your understanding and help!

 

DevAngelDevAngel
Sure I can help.  Here is a link that you will have to actually read.  I'm curious, would you expect to be able to use other technologies without learning about it?  If it's worth doing it's worth learning about.  Teach a man to fish and ,  well you know the rest.

http://www.salesforce.com/developer/docs.jsp

Cheers
SuperfellSuperfell
There's stuff in the getting started guide that you'll be able to easily adapt.
Vivek ManchandaVivek Manchanda
Hi

Can You plz tell me the way to use this "getUserInfo " and "getUserInforesult" .

I want to get the current user id to pass that Id to the query .

Thanks

Vivek Manchanda