I am trying to get a value of a field from leads. Here is the code i have
System.debug(' l.getSObject(name) is ' + l.getSObject('name'));
Where l is the lead
This gives out a error
FATAL_ERROR|System.SObjectException: Invalid relationship name for Lead
The same error is there for custom fields as well. Is there something i am not doing correct
Here is the documentation. http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject.htm#apex_System_SObject_getSObject