Prevent completion / closure of work orders with open labor transactions

Dominic (madd0g17 in our forum) has posted a great example of how he achieved this using an automation script.  It is loosely based on this article.  Here are the steps:

Thanks Dominic!!

 

Automation Script

LAUNCH POINT
Launch Point: WOLAUNCH
Object: WORKORDER
Object Event Condition: :status IN (SELECT value FROM synonymdomain WHERE domainid=’WOSTATUS’ AND maxvalue IN (‘COMP’,’CLOSE’))
Active: (checked)
Events: Add (checked), Update (checked)

SCRIPT
Script: WOOPENLT
Description: Prevent comp/close of WOs with open LT
Script Language: jython
Log Level: Error

VARIABLES
Variable: var_openlt
Description: input array variable to hold open labor transactions
Variable Type: IN
Binding Type: ATTRIBUTE
Launch Point Attribute: LABTRANS[finishdate IS NULL OR finishtime IS NULL].LABTRANSID*   (Note: The asterisk at the end is important!)
Override?: (checked)

CODE
Source Code:

if var_openlt is not None and len(var_openlt) > 0:

   errorgroup = ‘wo’
   errorkey = ‘openltexists’

Then in Database Configuration, I created a message (from Select Action->Messages menu) like:

Message Group: wo
Message Key: openltexists
Display Method: MSGBOX
Message ID: BMXZZ0001E (Customer Customization)
Display ID: (checked)
Value: Work Order cannot be completed or closed while labor transactions are still open.

Just make sure your Automation Script is set to Active and you’re good to go! It even works via the mobile application we built so if a user tries to complete/close a work order in our app, it will respond with an error message instead.

Series NavigationYour first Automation Script in Maximo 7.5 >

Did You Know...

As Maximo Experts, we have developed several add-on products for Maximo that mobilize the work force, simplifies assignments, provides ad-hoc reporting capabilities and facilitates the seamless integration of Service Requests into Maximo.

Check out our products by clicking on the following links: EZMaxMobileEZPLanner and EZInsight.

Find Out More

4 thoughts on “Prevent completion / closure of work orders with open labor transactions

  1. Can you please explain this – Launch Point Attribute: LABTRANS[finishdate IS NULL OR finishtime IS NULL].LABTRANSID* – is this a whereclause in the square brackets and what is the * for?

    Thanks!

    1. Yes, you can put a “whereclause” inside the brackets so that it will only find labor transactions that meet that criteria (in this case, “open” labor transactions). The * indicates that it should return an array of labor transactions (since there could be more than one).

Leave a Reply