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

Set of New Records, First of the month

Hey guys,


At the beginning of each month, I would like a set of new records for my custom object to be made. How would I go about doing this?




You can make use of scheduler class to create new record, after that you can schedule that class at the beginning of each month.


To invoke Apex classes to run at specific times, first implement the Schedulable interface for the class, then specify the schedule using either the Schedule Apex page in the Salesforce user interface ( App Setup->Develop->Apex Classes-> click on Schedule Apex button ), or the System.schedule method.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 




You can go with schedulable class. There is "Schedulable" interface that has to be implemented by a class in order to schedule that class. It has only single method named "execute" all the logic to create records for custom object must be implement in this method. And now you can schedule that class from -


setup--> App Setup --> Develop --> Apex Classess --> click on "Schedule Apex" button