+ Start a Discussion

Apex that needs to run the last day of the month

Hi all,


I am helping out a Non Profit with their Salesforce implementation. The process they want to put into Salesforce related to recurring donations is for the system to automatically create the Donation records for all the active recurring donations at the end of each month. They then send a report to each credit entity (Visa, Amex, etc...) so that they collect the money.


The credit entities produce back a report of what was actually collected and what wasn´t and at this point, they would like to find the automatically created Donations that did not go through and make them enter a recovery process.


So the question is: what is the best way to have Salesforce actually run a bit of code that creates all those donations? I know how to do the Apex bit what I am not sure how to accomplish is to have Salesforce automatically execute a script on a specific point in time. Any ideas much appreciated, it is for a good cause :smileywink:






PS: I know I can use a Visualforce page and make the users click a button but I would rather not follow that route if possible.


Best Answer chosen by Admin (Salesforce Developers) 
See: CronKit

All Answers


Unfortunately at this time I don't believe Salesforce APEX is able to run recurring scripts automatically. If anyone knows differently, please let me know.


The best thing for you to do is to write .NET or Java code that will run at the end of the month that will call a webservice in APEX that will do what you described above. At least with .NET and Java, I think you can write services that run once a month or something like that.

See: CronKit
This was selected as the best answer
Cronkit looks fab! Thanks John!!!!