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
subbu123.pbt@gmail.comsubbu123.pbt@gmail.com 

getUserInfo() method error

public class ToKnowUserInfo{

public void doGetUserInfo() {
try {
GetUserInfoResult result =connection.getUserInfo();
System.out.println('\nUser Information');
System.out.println('\tFull name: ' + result.getUserFullName());
System.out.println('\tEmail: ' + result.getUserEmail());
System.out.println('\tLocale: ' + result.getUserLocale());
System.out.println('\tTimezone: ' + result.getUserTimeZone());
System.out.println('\tCurrency symbol: ' + result.getCurrencySymbol());
System.out.println('\tOrganization is multi-currency: ' +
result.isOrganizationMultiCurrency());
} catch (ConnectionException ce) {
ce.printStackTrace();
}
}

}

 

While i compile this code i get error 
"Error: Compile Error: Invalid type: GetUserInfoResult at line 5 column 7" what is the reason ............knoe any ple tell me  

                                                                                                                                                                                                           thank u

vlachavlacha

you have to use System.debug(), java doesn't work for apex

 

Cheers!

V

Avidev9Avidev9
Well seems like you havent imported the necessary libraries and namespaces.

Try using the content assist to select "GetUserInfoResult" this will import the necessary files
subbu123.pbt@gmail.comsubbu123.pbt@gmail.com
i am not geting clarity , can elaborate ? what u said above
Avidev9Avidev9
GetUserInfoResult belongs to namespace. You need to import the namespace in you project to use them.

But if you are not sure about the namespace Eclipse has a content assist feature, which gives you suggestion based on what you type in. We generally use "CTRL + SPACE" to invoke the same. When you select the required class from the content assist all the dependencies are automatically imported into your project