Troubleshooting
Problem
The work orders are closed even if their tasks are not closed, although they have the "inherit status change" field checked
Diagnosing The Problem
This is not a issue, this is the default behavior for all Work Order Status.
It was determined that some of the tasks were not closed because they had unapproved labor
Failures to change status on a child Work Order or child task will not prevent the parent from changing status, with OOTB configuration
Resolving The Problem
A Conditional Expression can be created not to allow closure of work orders that still have unapproved labor associated. Bellow are the steps to create this expression:
1) Go to Administration > Conditional Expression Manager application
2) Click on the new row and complete the following fields:
Condition Description: CLOSE WO (or your desired description)
Type: EXPRESSION
Expression: EXISTS (SELECT 1 FROM LABTRANS WHERE GENAPPRSERVRECEIPT = 1 AND (REFWO = :wonum OR REFWO IN (SELECT A.WONUM FROM WORKORDER A WHERE A.PARENT = :wonum)))
Always Evaluate?: checked
Click on the detail link to verify this query:
SAVE
3) Go to System Configuration > Platform Configuration > Domains
4) Find for WOSTATUS and open the details for WOSTATUS values you want to apply the expression
Open the details for the CLOSE status and click View/Modify conditions
In the View/Modify Conditions window, insert a row. In the Expression field, paste the code from the expression you created
5) Click OK and Save
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21994653