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
silkkengsilkkeng 

Select Query in Salesforce

Hi,
As we frequently maintain our Opportunity especially introducing new Fields in salesforce.
Is it possible to do "SELECT * FROM the Object" instead of providing each field in the select query?

As if a new field has been created with mandatory, it will broken the custom code as well.


Regards,
silkkeng
foghornfoghorn
If you are using the officetoolkit you can use select * directly.
Other api clients require you to write your own select * (which is not difficult)
 
kavitha yogarajkavitha yogaraj
1. How to get all fields by Select * from the object? It was throwing me an error like this
Query API call failed with 400: '' - '[{"message":"\nSELECT * from ListView\n ^\nERROR at Row:1:Column:7\nunexpected token: '*'","errorCode":"MALFORMED_QUERY"}]'

I want to get address, email, phone through select statement.
I'm right now using this:  'SELECT SobjectType,Id, Name, Address from ListView'
whcih is not serving the purpose. 

2. How to get all the fields including address when getting the all the results ona  particular listId?

        $query_url = $instance_url . '/services/data/v32.0/sobjects/Lead/listviews/'.$listId.'/results';