You need to sign in to do that
Don't have an account?
ATTUS Tech
lastmodifiedbyid - need user name
This seems like a silly question, but I have not been able to find the answer. How do I get the username from the lastmodifiedbyid on custom objects? I've queried the user object, but it does not understand the relationship with 'user'.
select lastModifiedBy.Name from foo__c ...
All Answers
select lastModifiedBy.Name from foo__c ...
That got it, thanks. Information like this should be easier to find.
Here's the SOQL reference
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql.htm
I saw the reference, but could not find anything about the specifics of lastmodifiedby.
There's nothing special about lastModifiedBy its the same as all the other Foreign Key fields.
I still do not see anything in the doc that would have led me to this solution.
see the section on relationship queries
http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql_relationships.htm
What's confusing to many users is that in a query tool like Workbench, you see LastModifiedById, but you can't get to the user's name from there.
You have to trim the "Id" part and use LastModifiedBy in order to make it work. LastModifiedBy.Name