I'm trying to determine in a trigger, whether a lead belongs to a Queue or a User. What is the best way of going about this?
I tried the method mentioned in a dev. force discussion:
System.debug( lead.Owner.type )
... but this consistently keeps fetching null.
Alternatively, I was trying to determine by first 3 characters of the OwnerId (005 for User, 00G for Queue). I tried using:
lead.OwnerId.substring( 3 ) == '005'
Trying the above gets me Method does not exist or incorrect signature.
Any bright ideas here?
Thank you.