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
SharschSharsch 

Get all fields of event

Hi,

  I am using query something like this

  select ActivityDateTime, Description , Subject , Location from Event where OwnerId = '" + userId + "'";

  I want to a select query that will will give me all the fields not just ActivityDateTime, Description and Subject.

  In SQL terms I mean select * from Event where ownerid = 'userid' ;

  Please let me know.

Thanks,
Sharsch


Message Edited by Sharsch on 08-04-2008 02:36 PM
canonwcanonw
You can't do that in SOQL.  You must specify all fields explicitly. 
Drew1815Drew1815
Although SOQL doesn't support "select *" , you can generate the full list of fields by using the Describe api calls.

For example, DescribeSObject("Event") will return you a DescribeSObjectResult object. In that result object, there will be a list of Fields in an array as one of the properties. With that array listing of all the fields, you can dynamically construct your SELECT statement.

Here is the API reference documentation link for the DescribeSObject api call:
http://www.salesforce.com/us/developer/docs/api/index_CSH.htm#sforce_api_calls_describesobjects.htm
SharschSharsch
Thanks Drew for guiding on DescribeSObject("Event").

I found Apex Explorer which made my task easier. It gave me required SOQL statement and also I was able to graphically see all the fields that are under event (user defined and inbuilt).