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

Value of the record
Hi
I have custom object and account is lookup to my custom object field. I am able to retrieve account record value from the lookup field but I am getting the id of the record . I need to get the name of the record.
How can I achieve it?
for eg: The record name is Ac_record and is 123456609xya i am only getting id not the name of the record.
my code:
obj = select id, name, Location__c from customObj__c where id in: setId;
srting location = obj.Location__c;
location__c is lookup to Account
Please help me to solve this issue.
Thanks
Anu
Should be simple:
obj = select id, name, Location__r.name from customObj__c where id in: setId;
String accountName = obj.Location__r.name;
All Answers
Should be simple:
obj = select id, name, Location__r.name from customObj__c where id in: setId;
String accountName = obj.Location__r.name;
thanks you r right .. i was doing the same but not the right place .. i solved it