You need to sign in to do that
Don't have an account?
Vishnu_SFDC
Retrieve Data from a field using string.
Hello All,
I have the Api name of a field in string format. How can i retrieve the data from that field using that string. For example,
On Lead object i ahave a field called Points__c.
Now in apex code i have somthing like this. String field = 'Points__c';
From this how can i get the value of lead.Points__c?
Thanks in advance.
I have the Api name of a field in string format. How can i retrieve the data from that field using that string. For example,
On Lead object i ahave a field called Points__c.
Now in apex code i have somthing like this. String field = 'Points__c';
From this how can i get the value of lead.Points__c?
Thanks in advance.
it is easy. lead.get('Points__c');
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject.htm#apex_System_SObject_get