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
chiragmanochachiragmanocha 

Fetching all the fields of an entity

Hi All,

I want to do "select * from Account"

 

But as it is not possible to use * sign in query, please let me know How can I get all the field values of Account.

 

Thanks and Regards

--

Chirag Manocha

Best Answer chosen by Admin (Salesforce Developers) 
THustonTHuston

You get all the Field values by asking for them.

You have to type out every Field name in your SELECT statement.

 

You can dynamically get this list by calling:

Field[] fields = binding.describeSObject( "Account" ).getFields();       
for ( int i = 0; i < fields.length; i++ ) {
   System.out.println( fields[i].getName() );
}

All Answers

THustonTHuston

You get all the Field values by asking for them.

You have to type out every Field name in your SELECT statement.

 

You can dynamically get this list by calling:

Field[] fields = binding.describeSObject( "Account" ).getFields();       
for ( int i = 0; i < fields.length; i++ ) {
   System.out.println( fields[i].getName() );
}

This was selected as the best answer
chiragmanochachiragmanocha

There are three more fields in each and every entity bean class

 

__equalsCalc, __hashCodeCalc, typeDesc.

 

Do I need to filter it or this can be done by some special method ??