function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gmc74gmc74 

SOQL question

I am a pretty novice developer, mostly hack together code to do what I need.  I am writing an asp page in c# that gathers a list of current cases and I am running into an issue.

I grab a number of case fields, including one that is a lookup to a user (called RouteTo).  If I grab this field, it of course returns the user id, not the person's name.  If I grab RouteTo__r.Name instead of the RouteTo__c then it will return the value but it is nested, and I am not sure how to get to that in my code. 

Is there a simple way to get the query to grab the name instead of the id?

Thanks for your help

Grant
SuperfellSuperfell
if you're using the enterprise WSDL, then RouteTo__r should return a RouteTo__c object, and you can then get the Name property from that. e.g.

Console.WriteLine("{0}", row.RouteTo__r.Name);
gmc74gmc74
Thanks Simon, I will give that a try on Wednesday, happy new year!