Skip to main content
This guide covers administrative setup and configuration of Preventive Maintenance (PM) in the Facilities Management module.

Overview

As an FM administrator, you are responsible for:
  • Creating and managing PM templates
  • Setting up PM schedules for sites and assets
  • Configuring automation settings
  • Monitoring compliance and performance
  • Troubleshooting PM issues

Initial Setup

Configure FM Module Settings

1
  • Navigate to FM → Settings
  • Select the Maintenance tab
  • Configure PM-specific settings:
  • 2
    SettingDescriptionRecommended ValuePM Schedule Lookahead (Days)Days before due date to generate work orders7-14 daysAuto-Generate PM Work OrdersAutomatically create work orders when dueEnabled
    3
  • Click Save Settings
  • Verify Cron Job Setup

    PM automation requires scheduled jobs to run: Contact your system administrator to verify these are configured.

    Creating PM Templates

    PM templates define the maintenance tasks that will be scheduled.

    Step-by-Step Template Creation

    1
  • Navigate to FM → PM Templates
  • Click New Template
  • Fill in template details:
  • 2
    Basic Information
    3
  • Name: Descriptive name (e.g., “HVAC Filter Replacement - Monthly”)
  • Description: Detailed explanation of the maintenance
  • Asset Type: Select from picklist (HVAC, plumbing, electrical, etc.)
  • Frequency: How often (daily, weekly, monthly, quarterly, semi-annual, annual)
  • Estimated Duration: Expected completion time in minutes
  • 4
    Assignment
    5
  • Default Assignee: Technician to assign by default (optional)
  • Default Vendor: External vendor if outsourced (optional)
  • 6
    Compliance
    7
  • Compliance Required: Toggle if regulatory requirement
  • Compliance Category: Type of compliance (safety, regulatory, insurance)
  • 8
  • Click Save to create the template
  • Adding Checklist Items

    After creating a template, add step-by-step tasks:
    1
  • Open the template detail page
  • Navigate to Checklist Items tab
  • Click Add Item
  • For each item, specify:
    • Description: What to check or do
    • Pass Criteria: How to determine pass/fail (optional)
    • Required: Whether completion is mandatory
    • Display Order: Sequence in the checklist
  • Repeat for all checklist items
  • Example Checklist for HVAC Filter Replacement:
    1
  • Turn off HVAC system
  • Remove access panel
  • Remove old filter and inspect
  • Install new filter with correct orientation
  • Replace access panel
  • Turn on HVAC system and verify operation
  • Adding Required Materials

    Specify materials needed from inventory:
    1
  • Open the template detail page
  • Navigate to Materials tab
  • Click Add Material
  • Select the inventory item
  • Enter the quantity needed
  • Add notes if applicable
  • Repeat for all materials

  • Managing PM Schedules

    PM schedules link templates to specific sites for recurring maintenance.

    Creating a Schedule

    1
  • Navigate to FM → PM Schedules
  • Click New Schedule
  • Configure the schedule:
  • 2
    FieldDescriptionTemplateSelect the PM template to useSiteSelect the site for maintenanceStart DateWhen the schedule beginsNotesAdditional schedule-specific notes
    3
  • Click Save
  • The Next Due Date is automatically calculated based on the template frequency.

    Pausing and Activating Schedules

    To Pause a Schedule:
    1
  • Open the schedule detail page
  • Click Pause Schedule
  • Confirm the action
  • Paused schedules will not generate work orders. To Reactivate:
    1
  • Open the paused schedule
  • Click Activate Schedule
  • The next due date will be recalculated
  • Understanding Due Date Calculation

    Due dates are calculated based on frequency: Edge Cases:
    • January 31 + 1 month = February 28/29
    • Leap years are handled correctly

    Work Order Integration

    Automatic Work Order Generation

    When Auto-Generate PM Work Orders is enabled:
    1
  • Daily at 6:00 AM UTC, the system checks all active schedules
  • Schedules with next_due_date within the lookahead window are processed
  • Work orders are created with:
    • Type: preventive_maintenance
    • Priority: high for compliance PMs, medium otherwise
    • Due Date: The PM schedule’s due date
    • Linked Schedule: Reference to the PM schedule
    • Checklist Items: Copied from template
    • Materials: Suggested from template

    Manual Work Order Generation

    To manually trigger work order creation:
    1
  • Open the PM schedule
  • Click Generate Work Order
  • The work order is created immediately
  • Duplicate Prevention

    The system prevents duplicate work orders:
    • Only one work order per schedule per due date
    • Existing open work orders block new generation
    • Completed work orders update the schedule before next generation

    Compliance Tracking

    Compliance Dashboard

    Monitor PM compliance from the FM Dashboard:

    Overdue Alerts

    The check-overdue-pms job runs daily to:
    1
  • Identify schedules past their due date
  • Calculate days overdue
  • Categorize severity:
    • Warning: 1-3 days overdue
    • Critical: 4-7 days overdue
    • Severe: 7+ days overdue
  • Publish pm_overdue events for notification
  • Compliance Reporting

    For compliance audits, generate reports showing:
    • PM completion history by schedule
    • On-time completion rates
    • Failure documentation
    • Material usage

    Cron Job Setup

    PM automation requires two scheduled jobs.

    Work Order Generation Job

    Schedule: Daily at 6:00 AM UTC

    Overdue Check Job

    Schedule: Daily at 7:00 AM UTC

    Verifying Cron Jobs

    Check if jobs are scheduled:
    Check job execution history:

    Troubleshooting

    Work Orders Not Generating

    Symptoms: PM schedules are due but no work orders created Checklist:
    1
  • Verify Auto-Generate PM Work Orders is enabled in FM Settings
  • Check if schedule is Active (not Paused)
  • Verify schedule’s next_due_date is within lookahead window
  • Check for existing open work order for this schedule
  • Verify cron job is scheduled and running
  • Resolution:
    • Manually generate work order from schedule page
    • Check edge function logs for errors
    • Verify RLS policies allow work order creation

    Due Dates Not Calculating Correctly

    Symptoms: Next due date is wrong after completion Checklist:
    1
  • Verify template frequency is set correctly
  • Check that work order is linked to PM schedule
  • Ensure work order status is “completed”
  • Resolution:
    • Manually update schedule’s next_due_date
    • Verify the fm_update_pm_schedule_on_completion trigger is enabled

    Completion Not Updating Schedule

    Symptoms: Work order completed but schedule not updated Checklist:
    1
  • Verify work order has pm_schedule_id set
  • Check database trigger is active
  • Look for errors in database logs
  • Resolution:
    • Manually update schedule’s last_completed_date and next_due_date
    • Contact administrator to check trigger function

    Best Practices

    Template Design

    1
  • Clear Naming: Use descriptive names with asset type and frequency
    • Good: “HVAC Filter Change - Monthly”
    • Bad: “Monthly Maintenance”
  • Detailed Checklists: Include specific, actionable steps
    • Good: “Inspect belt tension, tighten if deflection > 1/2 inch”
    • Bad: “Check belt”
  • Pass Criteria: Define clear pass/fail conditions for compliance PMs
  • Material Accuracy: Keep material lists current with correct quantities
  • Frequency Selection

    Compliance Priority

    • Mark all regulatory, safety, and insurance-required PMs as Compliance Required
    • These get High priority work orders
    • Monitor compliance PMs separately from routine maintenance

    Schedule Organization

    • Create separate schedules per site, even for same template
    • Use consistent start dates for easier planning
    • Review and clean up unused schedules quarterly