⏰ Scheduled Job Monitor for Salesforce LWC
Monitor, manage, and analyze Salesforce Scheduled Apex Jobs directly from Lightning Experience with a modern reusable Lightning Web Component.
📖 Project Overview
Scheduled Job Monitor is a reusable Lightning Web Component that provides administrators and developers with a centralized dashboard for monitoring Salesforce Scheduled Apex Jobs.
Instead of navigating through Salesforce Setup pages, users can view scheduled jobs, inspect execution details, monitor upcoming schedules, abort running jobs, refresh data, search jobs, and analyze execution status directly from Lightning Experience.
The solution is built using Lightning Web Components, Apex, and Salesforce CronTrigger APIs while following Salesforce security best practices.
✨ Key Features
| Feature | Description |
|---|---|
| Scheduled Job Dashboard | View all scheduled Apex jobs from a single Lightning page. |
| Real-Time Refresh | Reload latest job information without leaving the page. |
| Search Jobs | Quickly locate scheduled jobs by name. |
| Status Monitoring | Track Waiting, Acquired, Executing, Complete, Error and Deleted jobs. |
| Abort Scheduled Jobs | Cancel scheduled jobs directly from Lightning. |
| Execution Details | Display next execution time, previous execution and schedule information. |
| Toast Notifications | Success and error messages for all operations. |
| Responsive Design | Works across desktop and tablet Lightning Experience. |
🏗 Solution Architecture
📁 Project Structure
force-app
└── main
└── default
├── classes
│ ├── ScheduledJobMonitorController.cls
│ └── ScheduledJobMonitorControllerTest.cls
│
├── lwc
│ └── scheduledJobMonitor
│ ├── scheduledJobMonitor.html
│ ├── scheduledJobMonitor.js
│ ├── scheduledJobMonitor.css
│ └── scheduledJobMonitor.js-meta.xml
│
└── permissionsets
└── ScheduledJobMonitor.permissionset-meta.xml
⚙️ Dashboard Information
| Column | Description |
|---|---|
| Job Name | Scheduled Apex class name. |
| State | Current execution status. |
| Cron Expression | Complete scheduling expression. |
| Next Fire Time | Next scheduled execution. |
| Previous Fire Time | Last successful execution. |
| Times Triggered | Execution count. |
| Actions | Abort and refresh operations. |
🔄 Monitoring Workflow
Load Dashboard
│
▼
Retrieve CronTrigger Records
│
▼
Display Scheduled Jobs
│
▼
Search / Filter Jobs
│
▼
Review Execution Details
│
▼
Abort Job (Optional)
│
▼
Refresh Dashboard
📊 Supported Job States
🔒 Security
- Uses with sharing Apex controllers.
- Supports Salesforce CRUD and Field-Level Security.
- Respects user permissions while displaying scheduled jobs.
- Permission Set included for easy deployment.
- Native Salesforce scheduler APIs used without external integrations.
🚀 Deployment
sf org login web --alias myOrg sf project deploy start \ --source-dir force-app \ --target-org myOrg sf org assign permset \ --name ScheduledJobMonitor sf apex run test \ --class-names ScheduledJobMonitorControllerTest
🎯 Business Benefits
- Eliminates navigation to Salesforce Setup.
- Provides centralized scheduled job monitoring.
- Improves administrator productivity.
- Quickly identifies failed or inactive jobs.
- Supports one-click job cancellation.
- Reusable across multiple Salesforce organizations.
- Modern Lightning user experience.
📌 Conclusion
The Scheduled Job Monitor provides Salesforce administrators and developers with a simple yet powerful interface for managing Scheduled Apex Jobs. By combining Lightning Web Components, Apex, and Salesforce scheduling APIs, the solution delivers real-time visibility into scheduled processes while simplifying monitoring and administration from within Lightning Experience.

No comments:
Post a Comment