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
yuyinchayuyincha 

How to user String to Get Data?

it means that maybe i can get data like this in apex(just like DataTable in some other language such as c#,):

 

<sObject sOs=[select name,id from account limit 1] ;

 

//use the filedname to get data 

String fieldname="name"; 

String fieldvalue; 

 

fieldvalue = sOs.get(fieldname);  Maybe sOs[fieldname];   Maybe sOs.getValue(fieldname);

 

How to do it as my case in apex? 

 

 

crazyforcercrazyforcer
Please refer Meta Data API User Manual. You can get the whole functionalities.
yuyinchayuyincha

Metadata API can modify force.com's base structure.

 

but i didn't find any infomation about my question.  

 

Metadata API is something about how to operate  the customerobject's structure.

 

and my question  is about how to query data form fixed structure .

yuyinchayuyincha

i find it.

 

http://wiki.developerforce.com/index.php/An_Introduction_to_Apex

 

this page  has the solution.