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
HaigyHaigy 

Links on record page to the record created before and after the record you are in

Is it possible to have two links on a record page to link you to the record which was created before the record you are currently in and record after?

 

Hope that makes sense

 

Regards

James

Jake GmerekJake Gmerek

The only way that I could think of it would be on a custom VF page.  In your controller, you could query your object with an ORDER BY created date, drop it in a list, and then find the record your are currently on in the list and then use that to get the record before and after, and create your elements accordingly.

CLKCLK
Possible. require two trigger. 1) before trigger - which will look for recent record & if found assign value to previous record field(url field) on current(this) record. query - [select id from yourObject order by createddate desc limit 1]; 2) after trigger - which will look for recent record & update that record with url of this record on "next record" field. query - [select id from yourObject where id != :thisrecord.Id order by createddate desc limit 1]; Note : before applying this functionality; you need to set OWD as atlest public Read & need to use role hierarchy access.