getUserInfo()

Retrieves personal information for the user associated with the current session.

Syntax

getUserInfoResult result = connection.getUserInfo();

Usage

Use getUserInfo() to obtain personal information about the currently logged-in user. This convenience API call retrieves and aggregates common profile information that your client application can use for display purposes, performing currency calculations, and so on.

The getUserInfo() call applies only to the username under which your client application has logged in. To retrieve additional personal information not found in the getUserInfoResult object, you can call retrieve() on the User object and pass in the userID returned by this call. To retrieve personal information about other users, you could call retrieve() (if you know their user ID) or query() on the User object.

Sample Code—Java

public void doGetUserInfo() {
  try {
    GetUserInfoResult result = connection.getUserInfo();
    System.out.println("\nUser Information\n");
    System.out.println("\tCurrency symbol: " + 
        result.getCurrencySymbol());
    System.out.println("\tOrganization name: " + 
        result.getOrganizationName());
    System.out.println("\tDefault currency code: " + 
        result.getUserDefaultCurrencyIsoCode());
    System.out.println("\tEmail: " + 
        result.getUserEmail());
    System.out.println("\tFull name: " + 
        result.getUserFullName());
    System.out.println("\tUser record ID: " + 
        result.getUserId());
    System.out.println("\tLanguage: " + 
        result.getUserLanguage());
    System.out.println("\tLocale: " + 
        result.getUserLocale());
    System.out.println("\tTimezone: " + 
        result.getUserTimeZone());
    System.out.println("\tOrganization is multi-currency: " + 
        result.isOrganizationMultiCurrency());
  } catch (ConnectionException ce) {
    ce.printStackTrace();
  }
}

Sample Code—C#

private void getUserInfo()
{
    //Invoke getUserInfo call and save the results in getUserInfoResult 
    
    GetUserInfoResult ui = binding.getUserInfo();
    // Get some of the user information 
    
    String orgName = ui.organizationName;
    String userFullName = ui.userFullName;
}

Arguments

None.

Response

getUserInfoResult

Fault

UnexpectedErrorFault

© Copyright 2000–2012 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.