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

No such columns error for standard fields on deploying to server from eclipse
I wrote this below apex code using eclipse and when i deploy to server and on validating it says no such column for address,owner,recordtype and created by. I tested with just Email and it worked perfectly. I even tried appending the column names with__c like custom fields but it didn't work.
public class Communication {
List<Lead> leads;
public List<Lead> getLeads() {
if(leads == null) leads = [select Address,Owner,RecordType,CreatedBy from lead limit 10];
return leads;
}
}
tell me how the standard fields should be represented using their api name.
Use OwnerId,CreatedById, RecordTypeId. There is no field for address, you will have to get City, State, Country and PostalCode separately. When in doubt, always look for the API name of the field.
When in doubt, use describe call on sobject to get field details. Here is the Apex documentation for describe feature - http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content%2Fapex_dynamic_describe_objects_understanding.htm|SkinName=webhelp
All Answers
Use OwnerId,CreatedById, RecordTypeId. There is no field for address, you will have to get City, State, Country and PostalCode separately. When in doubt, always look for the API name of the field.
When in doubt, use describe call on sobject to get field details. Here is the Apex documentation for describe feature - http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content%2Fapex_dynamic_describe_objects_understanding.htm|SkinName=webhelp