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
lodoss118lodoss118 

getting the most recent record?

Hi i was wondering what is the code or query to get most recent record i.e. what i am trying to do is attaching a task
to one record which has to be the most recent one if there are more than one of the record i want to update.

Ron HessRon Hess
SELECT Id, FirstName, LastName FROM Contact order by CreatedDate LIMIT 1
rajesh_yrajesh_y

hi once you try this

 

 

SELECT Id, FirstName, LastName FROM Contact order by CreatedDate DESC LIMIT 1