What are Scheduled Apex jobs and how do you create them?
Suggested answer
Scheduled Apex runs at a specified time by implementing the Schedulable interface and the execute(SchedulableContext ctx) method. Scheduling options:
1. UI: Setup > Apex Classes > Schedule Apex — define start/end dates and frequency.
2. Programmatic: System.schedule('JobName', cronExpression, new MySchedulable()); Cron format: '0 0 8 * * ?' (8 AM daily). Limits: 100 scheduled jobs per org simultaneously. Scheduled Apex itself has a limited context — it is common to call Database.executeBatch() from within the Scheduled Apex execute method to do the actual data processing. Monitor scheduled jobs via Setup > Scheduled Jobs or SOQL on CronTrigger and CronJobDetail.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.