I am trying to query records (of a custom object) that were created by the current logged in user.
I am trying to use the Created By field to check this. However I can't figure out what the field really is or how to compare it. If I get the record thusly:
SELECT id, Name, CreatedById '+'FROM Reservation__c
And then display this in a VF page I get a first name last name format with a link. I know that is listed as a lookup field, but is there a way to get the id number?
But on the same page if I use this VF markup:
Hello ID {! $User.Id }
I get an 18 digit user ID.
How can I get a CreatedBy ID that I can compare to the current user ID in Apex code?