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
shylajashylaja 

Clarification on Record ID

Hi,

 

When a record is created in Salesforce, is the record ID randomly generated or is it in ascending order?

Example: Can I use 'order by ID desc' in SOQL to fetch the last record that was created?

 

Regards,

Shylaja

@anilbathula@@anilbathula@
Hi Shylaja,

Yes you can use order by on id field and get the last record you have created.
raijade pankajraijade pankaj

Eazy way is to user created date.