Skip to content

# Preventive maintenance orders

A Preventive Maintenance or "PM" order is a "template" work order used to automatically generate Service Work orders on a schedule.

This is used to implement a preventive maintenance program.

A PM is mostly identical to a Service Work order but has some additional fields in it's header area used to set the schedule for generating Service Work orders.

We won't document the identical features here, only the features that are different on a PM from a service work order.

See the Work order documentation page for all other features and details.

## Authorization Roles required

Many roles can select this object on other records where approriate. Editing or viewing this object in detail is only available to Users with the following roles:

Full access

- Business administration
- Service manager

Read only access

- Business administration - restricted
- Service manager - restricted
- Sales
- Sales - restricted

## How to access Preventive maintenance

P.M. are accessed in the following ways:

- From the `Service` navigation drawer `Preventive maintenance` item to open the P.M. data table
- From any data table column showing P.M.s such as the Work order table

## PM data table

The Preventive Maintenance data table lists all the P.M.'s available, provides the '+' link to create a new P.M..

### Table menu options

In addition to the common data table menu options, the PM table form also has these unique menu options:

#### Items

Click on this option to drill down into the individual PM Items data table and also access the data table lists of all sub items such as Parts, Labor etc for each PM item.

#### New Customer menu option

Click on this option to create a new Customer record.

## How Preventive maintenance works

AyaNova server runs a PM generation job every 5 minutes looking for Preventive Maintenance orders which have reached the conditions required to create a service Work order.

### Conditions required to generate a work order

PM's will be turned into service work orders based on the following conditions:

- PM's previously calculated internal generate date has been reached
- PM is set to Active
- PM's Stop generating date has not yet been reached
- The Customer selected on the PM is set to Active

When these conditions are met the AyaNova server will generate a new service work order from the corresponding fields in the PM and it will appear in the Work order table, on the Service managers schedule form and any scheduled users will see their scheduled items in their personal schedule form.

### How a work order is generated

When a PM is turned into a work order the server directly copies the corresponding fields from the PM to a new Work order exactly as entered in the PM but some fields require special handling:

#### Date fields

When a work order is generated from a PM the PM is then updated to move all the relevant date fields forward for the next work order generation.

The following date fields are automatically moved forward:

- Service date
- Work order item Request date
- Scheduled user Start and Stop dates
- Loaner item Out, Due and Returned dates
- Labor Start and Stop dates
- Travel Start and Stop dates
- Task Completion date
- Outside service Sent, ETA, Returned dates

#### Wiki

If the PM has a Wiki and the Copy Wiki PM field is set to true the Wiki is copied from the PM to the service work order.

#### Attachments

If the PM has attachments and the Copy Attachments PM field is set to true the Attachments are copied from the PM to the service work order.

### How a PM is updated after a work order is generated

Once the new Work order is successfully generated the source PM is updated so that it's ready for the next generation.

#### New service date calculated

A new Service Date is calculated by taking the current Service Date that was just used and adding to it the duration specified in the Repeat interval field set on the PM header.

It then checks the Exclude days of week setting in the PM header and if the new service date falls on an excluded day it moves the date forward until it reaches a day of the week that is not excluded. This is now the new Service date and is set on the PM.

#### Generate date calculated

PM's have an internal Generate date field which is used to determine the time and date that a new service work order is generated. This is separate from the service date and is calculated based on the new service date minus the Generate beforehand setting in the PM header. The generate date is calculated at this point and set in the PM internally.

#### Stop generating date checked

The server checks to see if the new Service date will fall beyond the PM headers Stop generating date setting. If so, the PM is automatically de-actived by setting the Active field to false and saving the PM. Generation stops at this point for this PM until it's set back to active and it's dates reconfigured or it simply remains inactive and will not be touched again by the server.

If the stop generating date will not be reached then the server continues to modify the PM to prepare for the next generation:

#### PM dates moved forward

The server calculates the exact time span between the current Service date just used to create a work order and the new service date that was just calculated. This time span is then used to adjust all the PM's date fields forward so they all fall on the same relative day and time from each other.

At this point the PM is saved with it's new settings for the next time and generation for the PM is completed.

### Schedule conflicts handling

Normally if the Global setting Allow schedule conflicts is set to False then a work order item scheduled user record can not be saved if there is a schedule conflict. In the case of a PM automatically generating a work order however, this could prevent the entire Work order from being generated so schedule conflicts are allowed when a service work order is generated.

### Insufficient inventory handling

AyaNova removes inventory from stock immediately upon a Work order item Part record being created and saved and the same is true if the Work order is generated by a PM at the server automatically.

During the Work order generation from a PM, inventory levels are checked and if they are found to be insufficient the amount that is in stock is set on the Work order item Part record created (or zero if none are in stock) and a Work order item Part Request is automatically added to the Work order that is being generated with a quantity equal to the needed balance.

For this reason, it's helpful to set the Generate before setting on the PM far enough in advance to handle ordering in parts if necessary.

To avoid this situation entirely, AyaNova provides an Insufficient inventory warning notification event subscription which will alert the notification subscriber that at that moment in time there is insufficient inventory to fulfill an upcoming PM.

### Notification subscriptions related to P.M.s

#### Preventive maintenance stop date

Notification to remind subscriber that the PM has reached it's stop generating date with settable advance notice. Use this as a reminder to review with the Customer and possibly re-activate this PM or adjust as necessary. To reactivate means setting it to Active and choosing a new future stop generating date.

This is a Tag filterable notification so the notification subscription can have tags set so that only PM's with matching tags trigger this notification.

#### Preventive maintenance generation failure

Notification that there was an error or issue of some kind related to generating a work order from a PM. The error message will be provided and if it's unclear what the problem is, there maybe more information available in the AyaNova server operations log.

PM's with temporary issues preventing generation of a work order will try again the next time the PM generation job runs at the server which is every 5 minutes. If the same error arises it will not be sent in a notification to the User for another 12 hours in order to prevent flooding the User with identical notifications.

This notification is not filterable by Tag, it will trigger if any PM can't generate a work order.

#### Preventive maintenance insufficient inventory

Notification that there will be insufficient inventory to meet the requirements of the PM Parts.

When a PM's next Generate date is found to be within the date range set by the notification subscription's "Notify before event" duration setting, the PM will be fetched and a total required quantity calculated for each unique part / warehouse combination for that PM. Then this list will be checked against inventory and any insufficient quantities will be placed into a list of items sent with the notification.

Note that this is the inventory at that moment in time and for some shops depending on part turnover it may be useful to subscribe to this notification more than once, each with varying settings for "Notify before event". Perhaps one set for double the length of time it takes to get parts on average ordered in and a second one at the deadline for ordering parts or even more depending on importance and specific needs of each shop.

The notification will only be sent if there are not enough parts.

A PM will in any case generate the work order even with insufficient inventory by making Work order item Part Request records for any inventory found to be out of stock at time of generation, however, this may be too late for some scenarios so this notification exists to avoid that situation.

This notification will be sent once only every 90 days per subscription as it relies on checking against prior notifications sent out and kept note of in a notification delivery log that automatically removes entries older than 90 days. This means if you set the Notify before event duration in the subscription to more than 90 days you may see more than one of these notifications for the same PM but if it's less than 90 days you will receive only one notification.

This is a Tag filterable notification so the notification subscription can have tags set so that only PM's with matching tags are checked for insufficient inventory.

## PM edit form unique fields

Note that a Service Work order and a P.M. are identical for the most part except for the header portion of a P.M. with fields related to PM's specifically.

The PM edit form provides all the standard edit form functionality and the following fields that are not found on a Service work order:

#### Repeat interval

This field is used to set the length of time between service work orders being generated from the PM by selecting a time period and quantity. This value must be larger than the Generate before field value to pass validation when saved.

So, for example, if you wish to service a customer once per year then the Repeat interval should be set to 1 year.

#### Generate beforehand

This field is used to set how far in advance of the Service date the service work order should be created. This value must be smaller than the duration set for Repeat interval or the server will not allow the record to be saved.

This should be set taking into consideration how much advance notice is required to ensure sufficient inventory and scheduling before service needs to be performed. There is no harm in setting this earlier than you expect to need, it will appear in the schedule for the appropriate time and gives staff time to be ready for service.

#### Exclude days of week

Here you can control which day of the week you don't want the next service date to fall when it is calculated. AyaNova will automatically advance the next service date it calculates one day at a time until it hits on a day that is not excluded. Selecting all days of the week is not valid here or nothing would be generated. Typically this is used to exclude weekends.

#### Next service date

When you first create a PM this is the date that will first be used to set the service work order's Service date field. Subsequently the AyaNova server will automatically advance this date for you each time it generates a new service work order.

#### Stop generating date

This optional field is used to set a limit to how long this PM will generate work orders. When it detects that a new work order would be generated beyond this date it automatically sets the PM to inactive and stops processing it.

#### Copy wiki

When checked the PM will copy all wikis (Header wiki, work order item wiki and Unit wiki) over to the service work order generated.

#### Copy attachments

When checked the PM will copy any PM header section attached files over to the service work order generated.

#### Active

On a PM the Active field controls whether the PM will be considered for generating service work orders. Unchecking Active is a short cut to turn off a PM from generation.

### Menu options

In addition to the common edit form menu options and the same options shared with and documented on the work order help page, the Preventive Maintenance edit form also has these unique options:

#### Duplicate to Work order

This menu option makes a service work order by copying the shared fields from the PM to a new service Work order. This is and "on demand" way to turn a PM into a service work order manually; outside the normal automated Preventive maintenance scheduled work order generation system. This is a direct copy of the PM fields you see, dates are not adjusted here.

#### Duplicate to Quote

This menu option makes a Quote by copying the shared fields from the PM to a new Quote. Use this feature if an existing PM is nearly identical to a Quote that needs to be made to save typing or to re-quote an existing PM schedule that's nearing it's end of term.