Scheduling Jobs for Recurring Transactions

In Salesforce, an “Apex job” generally refers to a scheduled or batch process written in Apex, Salesforce’s proprietary programming language. These jobs are used to execute custom logic or perform specific operations within the Salesforce environment. There are primarily two types of Apex jobs: Scheduled Apex jobs and Batch Apex jobs.

Scheduled Apex Jobs: 
Scheduled Apex jobs run at specified intervals according to a schedule. You use the `Schedulable` interface to create these jobs.

Batch Apex Jobs: 
Batch Apex jobs are used to process large amounts of data in smaller, manageable chunks (batches). They implement the `Database.Batchable` interface.

How to setup Aedon Jobs:
There are several ways to schedule the Apex class in Salesforce. Here, we’ll use the Salesforce UI to schedule the class.

  1.    Go to Setup (gear icon) > Scheduled Jobs.
  2.    Click “New” to create a new scheduled job.
  3.    Select the class you want to schedule (e.g., `scheduledSalesPaymentBatch`).
  4.    Enter a name and optional description for the job.
  5.    Choose the frequency and timing for the job execution.
Recurring Transaction Apex Class
Sales Payment Schedule scheduledSalesPaymentBatch
Purchase Payment Schedule scheduledPurchasePaymentBatch
Revenue Recognition scheduledSIRevenueRecognitionBatch
Expense Recognition scheduledPIRevenueRecognitionBatch
Recurring Sales Invoices scheduledRecurringSalesInvoicesBatch
Recurring Purchase Invoices scheduledRecurringPurchaseInvoicesBatch
Recurring Journals scheduledRecurringJournalBatch
Auto Reverse MJ scheduledAutoReversalManualJournalBatch

Verify the Scheduled Job: 
You can go back to the “Scheduled Jobs” page in Salesforce Setup to verify that your scheduled job is listed and active. Now, the `execute` method in the `scheduledSalesPaymentBatch` will be invoked according to the schedule you specified.

Go to Top