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
Bhuvanesh MohankumarBhuvanesh Mohankumar 

SELECT * FROM ACCOUNT

Hi,

I am a beginner to Salesforce, I understand that salesforce query works only with particular field name,
I am curious to know, is there any option to use a wildcard character or keyword to list all the fields in the object as similar to a SQL query.

Say for sample: SELECT * FROM ACCOUNT
Instead of: SELECT ID FROM ACCOUNT
Best Answer chosen by Bhuvanesh Mohankumar
Bhuvanesh MohankumarBhuvanesh Mohankumar
As result of research,

Reference: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm

Specifies a list of one or more fields, separated by commas, that you want to retrieve from the specified object. The bold elements in the following examples are field list:

SELECT Id, Name, BillingCity FROM Account
SELECT count() FROM Contact
SELECT Contact.
Firstname, Contact.Account.Name FROM Contact

Solution:
You must specify valid field names and must have read-level permissions to each specified field. The fieldList defines the ordering of fields in the query results.
fieldList can include a subquery if the query traverses a relationship. For example:
 
​SELECT Account.Name, (SELECT Contact.LastName FROM Account.Contacts) FROM Account

 

All Answers

Alain CabonAlain Cabon
Hi,

That is not possible with the standard SOQL without pre-processing reading the metadata.

Cloudingo Studio offers "all fields" with "*" ( extended SOQL in SOQL+) but there is a pre-processing reading all the fields of the object from the metadata by the studio:  https://www.symphonicsource.com/cloudingo-studio/

SOQL+ is not a language of request of Salesforce.
Bhuvanesh MohankumarBhuvanesh Mohankumar
As result of research,

Reference: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm

Specifies a list of one or more fields, separated by commas, that you want to retrieve from the specified object. The bold elements in the following examples are field list:

SELECT Id, Name, BillingCity FROM Account
SELECT count() FROM Contact
SELECT Contact.
Firstname, Contact.Account.Name FROM Contact

Solution:
You must specify valid field names and must have read-level permissions to each specified field. The fieldList defines the ordering of fields in the query results.
fieldList can include a subquery if the query traverses a relationship. For example:
 
​SELECT Account.Name, (SELECT Contact.LastName FROM Account.Contacts) FROM Account

 
This was selected as the best answer