+ Start a Discussion
Jamz_2010Jamz_2010 

Select into Array of Strings

Hi all,

 

I'm trying to select all the fields in salesforce for a given account and then put these into an array of strings so I can then send them to my web service, however, I cannot find any way of either doing a Select * from the database or putting the results into an Array.

 

Thanks

 

James

xnerd00xxnerd00x
there is no select * in SOQL.  However, an easy way to get all the fields is to go through Apex explorer and check the all fields box.  Every field will be in query window - so you can just copy and paste that into your code.  As for the array issue, that really shouldn't be an issue.  You have the sObject where you can get the values from.  There really is no need for an array.
Jamz_2010Jamz_2010

Thanks for your reply, the issue is that I need to make the Select dynamic so if a new field is added it will automatically select it. Also, I need to be able to put the results into a string in the order that they were selected as this will allow me to pass the array to my web servce (Salesforce doesn't seem to allow the passing of SObject as they throw an error when you try to parse the WSDL).

 

Thanks for any further help.

 

James