Using the “After PM Generation” Workflow Rule to Auto-Apply Schedule Dates
The After PM Generation rule can be used to specify a schedule date for PM Schedules. The schedule date is calculated from a field on the PM which, at generation time, is added to the WO Date field to get the scheduled date.
For example, you have PM Schedule that must be completed within seven days of generation. A field called “Days to Complete” is placed on the PM Schedule form and contains a value of 7. When this PM is generated, the system will add 7 days to the WO Date and place that value in the Schedule Date field.
You'll need to following to complete this task:
- The knowledge to create new fields on a detail form. If you need instructions on creating new fields, see the system administration guide.
- The security permissions to create new fields and access the Workflow Manager.
Begin by creating a numeric field on the PM Schedule that will contain the amount of days to complete the PM. For these instructions we use “days_compl” as the fieldname, “Days to Complete” as the field description and select 'Numeric' as the field type.
This example also requires the “Sched. Date” field be on the Work Order form.
Configure the rule by following these instructions:
- Enter the Workflow Manager. It is located in the Administration section of the Navigation tab.
- Click the Add New Record link on the Workflow Manager's list view.
- Enter the Workflow's description in the Workflow Description field and set the Active field's value to 'True'. Click Save New Record to save the Workflow and reload the page in Detail view.
- Click Configure to open the Workflow Manager's configuration page.
- Use the “Choose a rule” drop-down list to select “After PM Generation”. The rest of the configuration page will appear.
- Place a check in the “with custom condition” checkbox and click the Action button.
- Place a check in the “replace field with value” checkbox.
- As you place the checks in the checkboxes, the parameters of the rule appear in the gray box. In this box, click the links to configure the parameters.
- With custom condition – Click this link to open the custom filter tool.
- Place the title of the filter in the Title field, then click the Save icon (not the Save button at the bottom of the form).
- Using the drop-down list located to the right of the “Work Orders (WORK)” row and below the “Fields” column, select “PMID” and click the Enter button next to the drop-down list. The PMID list will appear in the criteria list (see below if PMID does not appear in the list).
- Click the Filter icon (currently shaded) on the PMID row to open the Update Criteria window.
- For “Operator”, select “Greater than”
- Click the “fx” link on the right of the Criteria field, then enter the code “SPACE(10)” in the Criteria field. Exclude the quotation marks.
- Click the Update button to save the filter.
- Click the Save button to save the custom filter.
- Table – Click this link to bring up the drop-down list of available tables for this workflow. Choose “Work Orders --- WORK” then click Save.
- Field – Click this link then use the drop-down list to select “Sched. Date”. Click Save.
- Value – Click here and enter this code “$$Work.date_wo+pm.days_compl$$” on the field provided, then click Save. Exclude the quotation marks.
- Click Save Workflow to save the new workflow.
The Workflow is now set. Test it by placing a '7' in the “Days to Complete” field on the PM form, then click Manually Generate. The PM will be generated and the “Sched. Date” field will be populated with a date 7 days from today's date.
- If you are using the “Sched. Date” field on the work order form, you can use a different field instead. In the “Field” link on the Workflow Manager Configuration page, replace “Sched. Date” (see example above) with the fieldname of your choice.
- If “PMID” does not appear in your drop-down, the field needs to be added to the Query Tool. Enter any Work Order and enter design mode (Options > Customize form). Add PMID to the form by clicking an empty placeholder and using the “Add Existing Field” section. Click Select Field to place the field on the form. Next, click on the Properties link for the PMID field. On the Field Properties window, place a check in the “Query Tool” checkbox and click Save. The field is no longer necessary. Remove it by clicking the trash can icon.
- If you are having difficulties with these instructions, don‟t hesitate to call eMaint Technical Support for assistance.