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
hickmandhickmand 

Day of Month driven Autocreate new record

I am new to Apex Coding.  I'd like to create a trigger that creates a new child record every month on the same day.

 

I am trying to generate a current billing record which is a child of the master which is a member data record which has the monthly billing amount.  On the first of every month, I'd like to autocreate a new billing record.

 

Can someone send me in the right direction...I believe there may be more than one way to achieve this.

 

Thanks

MiddhaMiddha

You can write your business logic in a class and schedule that class to execute on 1st of every month. 

 

In case your data set is large you can write a Batch job which would pick all the eligible records and create related records on a specific day.