I have a custom object called Sport, and sport has an Owner like every other object. When I do a Query on Sport:
Map SportMap=new Map([SELECT Id, OwnerId, Owner.Email FROM Sport__C Limit 50000]);
It works just fine, but as soon as I change Owner.Email to Owner.NewRole__c which is a custom field on the user record, it gives me an error message: No such column 'NewRole__c' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Why is that and how can I fix it? Thanks!