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
Rakesh SRakesh S 

Getting no.of fields using SOQL query

Hi All,

For example, i have a requirement to display all fields of the object. Assume that Object has 100 fields.
Can i fill all 100 fields in a single query? how we can display. please give me appropriate solution(Query).

Thank you all.
Best Answer chosen by Rakesh S
gautam_singhgautam_singh
Hi Rakesh, 

You can try writing a method in your utility class as in the following link : 

http://singhgautam02.blogspot.com/2015/01/dynamic-soql-field-names.html (http://singhgautam02.blogspot.com/2015/01/dynamic-soql-field-names.html" target="_blank)


Important :

If you have received the answer which you are looking for, Please mark it as a Solution, this will help others to find the resolution of problem with ease. More, you can make the Developers of the Community smile by appreciating the answer with the "Like" Button. We would love to help you again. 

Thank You
Gautam Singh 
Blog - http://singhgautam02.blogspot.in/
Me   - about.me/singhgautam




 

All Answers

Phil WeinmeisterPhil Weinmeister
Hi Rakesh,

There's nothing equivalent to SQL's "*". However, here's some input on what you might be able to do:

https://developer.salesforce.com/forums/ForumsMain?id=906F00000008oLMIAY

Thanks,
Phil
gautam_singhgautam_singh
Hi Rakesh, 

You can try writing a method in your utility class as in the following link : 

http://singhgautam02.blogspot.com/2015/01/dynamic-soql-field-names.html (http://singhgautam02.blogspot.com/2015/01/dynamic-soql-field-names.html" target="_blank)


Important :

If you have received the answer which you are looking for, Please mark it as a Solution, this will help others to find the resolution of problem with ease. More, you can make the Developers of the Community smile by appreciating the answer with the "Like" Button. We would love to help you again. 

Thank You
Gautam Singh 
Blog - http://singhgautam02.blogspot.in/
Me   - about.me/singhgautam




 
This was selected as the best answer