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

SWITCHING content on a site daily

Hi guys,

I imagine a visulaforce site with a daily switching content (i.e. tip of the day). What would be the best solution to implement this requirement?


Thank you,



This could be done a number of ways. Here's probably the way I would accomplish this:


* Custom object that stores quotes for each day. It should maintain a sequencial order of records numerically, perhaps through a trigger or bulk update code.

* When displaying the page, query the highest sequence number, convert the current date into a number of days, divide that number by the number of record sequences (using modulus division), and then retrieve the record that matches that result.