You need to sign in to do that
Don't have an account?

how to retrive fieldname from object then get value from that fieldname value from some other object
Hi
I am storing object field name in other object
EX
objeContainer - objects store name, start_c. name means calendar name , strats_c store startingDate.
first
i need to get field name
then
from the field name i need to get value from other object
i am getting field name by the following query
thisEvent =SELECT Id, Name, start__c from myCalendar__c Limit 4
here after i need to get values from other object
here i am getting problem . how to query fieldname and get their appropriate values
i am getting error when i query like this
like this
select thisEvent.Id,thisEvent.Name,thisEvent.start__c
i got strucked in this stage how to proceed further .
Suggestions and examples are welcome
Thanks in advance
All Answers
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm
thisEvent =SELECT Id, Name, start__c from myCalendar__c Limit 4
field1 = thisEvent.Id;
field2 = thisEvent.Name
field3 = thisEvent.objectName;
String qry = 'SELECT ' + field1 + ', ' + field2 +' FROM ' + field3;
List<sObject> rslt = Database.query(qry);
here i am getting problem i am actually don't know which kind of object i need to create list -- List<sObject> ?