Maximo Open Forum

 View Only

 Copy Value From WPLABOR to LABTRANS

Jump to Best Answer
  • Administration
  • Everything Maximo
  • Service Provider
Stephen Rievaj's profile image
Stephen Rievaj posted 07-07-2021 15:05
Hello,

I have added a new field to WPLABOR and LABTRANS.  I need to copy the value from WPLABOR to LABTRANS when the user uses the Select Planned Labor button.

I have tried using a crossover domain and automation scripts without success. 

Does anyone know how to accomplish this without writing java?

I am on Maximo 7.6.1.2, so I do have access to event based automation scripts.

I suggestions would be appreciated.

Thanks,
Stephen
Steven Shull's profile image
Steven Shull Best Answer
I'm not sure how you could do this well without extending the copyPlanLaborToLabTransSet method in the WO class to add in your additional logic. Neither of the records store a reference to the other which is why a crossover won't work and most automation script launch points won't either. If I were to attempt this and needed to do it via script, I would look at replacing the OK button on the aclabor dialog in the library.xml with an automation script action event. IE I'd replace this:

<pushbutton default="true" id="selpllabor_2_1" label="OK" mxevent="dialogok" value="copyPlanLaborToLabTransSet"/>

with

<pushbutton default="true" id="selpllabor_2_1" label="OK" mxevent="myautoscript"/>

Make sure in each application you created the necessary signature options for your script and then it should fire. With 7.6.1+ you can interact with the UI elements, like closing the dialog and getting the selected set from the dialog.

Adding the additional attributes is going to be hacky though, as you either have to execute the core logic of copyPlanLaborToLabTransSet yourself (which means that changes they make will be lost) or you have to iterate on it again after and try and match the two up which may or may not be reliable. As an example, I looked at O&G/HS&E and SP and both extend this function. O&G/HS&E need to copy a field so they look for planned labor for the same laborcode & craft but you can have multiple entries for the same laborcode & craft so that's not reliable. SP looks much deeper (laborcode, craft, skilllevel, vendor, contractnum, and taskid) but again even that isn't 100% reliable.

If you need something "good enough" you can go down their route of trying to add after the fact. If you need something 100% I think you have to extend the java class or request that IBM adds an attribute to LABTRANS to store the reference back to WPLABORID.
Stephen Rievaj's profile image
Stephen Rievaj
Thank you Steven.  I followed your suggestion of updating the library xml and using an automation script.  I created a new instance of the dialog, since this is for SP work orders.

I added savemode="ONLOADUNLOAD" to the dialog tag, so the table would refresh as soon as I clicked OK on the dialog.