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
pjaenickepjaenicke 

Referencing the User table

Listers,

 

We have a "Manager" field on our user table that's just a lookup to the user table, (it holds a reference to that user's manager).  On another table, I also have a lookup to the user table, called "Associate".  If I wanted to also retreive the last name of that Associate's manager, I can do so with a formula field:

 

Associate__r.Manager__r.LastName

 

Here's my question:

Why doesn't this also work with the Owner field?  i.e.,

Ownerid__r.Manager__r.LastName

 

Thanks,

Pete

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

It'll depend on exactly which owner field you're looking at. Some of them are polymorphic, they relate to Users & SelfserviceUsers. In the case of polymorphic FK's, only a very limited subset of fields are available using the . notation. see the Name entity in the SOQL-R docs for more info.

All Answers

SuperfellSuperfell

It'll depend on exactly which owner field you're looking at. Some of them are polymorphic, they relate to Users & SelfserviceUsers. In the case of polymorphic FK's, only a very limited subset of fields are available using the . notation. see the Name entity in the SOQL-R docs for more info.

This was selected as the best answer
pjaenickepjaenicke

I see what you mean.... "Owner" may not always refer to a User Id, (it may be a Queue, for instance).

 

(Though I'd be perfectly fine if it returned Null in those cases) :)

 

Pete