Before you begin
Plans: Enterprise only
Audience: Administrators
When users close work orders without recording how much time they spent, you lose valuable cost information for your assets and work orders, which prevents you from getting the full value out of your CMMS. If a work order is closed without labor hours, this workflow sends a notification to the users you select, and automatically reopens the work order.
Configuration overview
Goal
Reinforce the logging of labor hours by reopening work orders that were closed without them and notifying the appropriate users
Trigger
Type | What it does |
---|---|
Field was changed to a specific value | Fires whenever a work order is closed (i.e. its status is changed to the one you select in this trigger) |
Activities
Type | What it does |
---|---|
Run separate activities based on an if/else condition |
This is the condition activity where you specify what the workflow looks for when it's triggered. In this case, it's checking whether the work order is missing missing labor hours. When the condition is met (i.e. when the work order doesn't have labor hours), the next two activities occur. There are no activities if the condition is not met (i.e. when the work order has labor hours). |
Send a notification to a user(s) or group(s) |
This is the first sub-activity that occurs when the condition is met (i.e. when a work order doesn't have labor hours). It sends a notification to the users you specify to let them know that the work order was closed without any labor hours. |
Update a selected field value within a defined object |
This is the second sub-activity that occurs when the condition is met (i.e. when a work order doesn't have labor hours). It reopens the work order by changing its status to whichever one you select in the activity. |
Steps
- Go to Settings > Workflows.
- Click New:
- Enter a name for your workflow.
- In the I would like to section, select Run separate activities based on an if/else condition:
- In the Every time that a section, select Field was changed to a specific value:
- Click OK.
- To configure the trigger:
- Click the Trigger tab:
- In the Field drop-down list, select Work Order - Work Order Status id:
- In the Value drop-down list, select the status that your organization uses for closed work orders (e.g. Closed, Completed):
- Click OK.
This closes the workflow, which is necessary to apply your trigger settings before moving on to the next step.
- Click the Trigger tab:
- To configure the activity:
- Click the workflow to open it again.
- In the Activities tab, click the activity that was created automatically based on the option you selected in step 4:
- In the Condition field, enter the following code to have the workflow check whether the work order is missing labor hours:
rec.dblTimeSpentHours is null
- To configure the sub-activity that sends the notification:
- In the Execute these activities when the condition is true section, click the + button:
- Enter a name for the activity.
- Select the Send a notification to user(s) or group(s) option:
- Click OK.
- In the Recipients field, select the users you want to send the notification to.
- In the Subject field, enter the subject you want to use for the notification (e.g. "Work order closed without labor hours").
- In the Body field, enter the following HTML:
<p> The following work order was closed without labor hours: </p>
<ul>
<li><b>WO Code</b>: <ma:expr expr="rec.strCode"/></li>
<li><b>Description</b>: <ma:expr expr="rec.strDescription"/></li>
<li><b>Priority</b>: <ma:expr expr="rec.findRelatedRecord('intPriorityID').strName"/></li>
<li><b>Maintenance Type</b>: <ma:expr expr="rec.findRelatedRecord('intMaintenanceTypeID').strName"/></li>
<li><b>Modified By:</b>: <ma:expr expr="rec.findRelatedRecord('intLastModifiedByUserID').strFullName"/></li>
</ul> - If you want to see what the message will look like, click Preview. There may be some slight formatting differences between the preview and the actual notification email.
- Click OK:
- In the Execute these activities when the condition is true section, click the + button:
- To configure the sub-activity that reopens the work order:
- In the Execute these activities when the condition is true section, click the + button:
- Enter a name for the activity.
- Select the Update a selected field value within a defined object option:
- Click OK.
- In the Field drop-down list, select Work Order Status id:
- In the Value drop-down list, select the status you want to change the work order to (e.g. Open):
- Click OK.
- In the Execute these activities when the condition is true section, click the + button:
- Click OK:
- To activate the workflow, switch the status toggle to Active:
- Click OK.
Once your workflow is activated, you may want to test it by closing a work order without labor hours and validating that the workflow ran successfully. To learn more, see Monitor workflow activity.