-
Log in to Maximo with administrative privileges.
-
Navigate to the "Automation Scripts" application.
-
Click on the "New Script" button to create a new script.
-
Provide a name for the script, such as "CopyFieldsFromPersonToWO."
-
In the "Object" field, select "WORKORDER" from the dropdown menu.
-
In the "Attribute" field, select "add" and enter "BUACCESS" as the attribute name.
-
In the "Attribute" field, select "add" again and enter "BUACCESSTEXT" as the attribute name.
-
In the "Launch Point" section, select "Create" from the dropdown menu to trigger the script when a new work order is created.
-
In the "Script" section, enter the following code:
from psdi.server import MXServer
personSet = MXServer.getMXServer().getMboSet("PERSON")
personSet.setWhere("personid = :reportedby")
personMbo = personSet.moveFirst()
if personMbo is not None:
woMbo.setValue("BUACCESS", personMbo.getString("BUACCESS"), 11L)
woMbo.setValue("BUACCESSTEXT", personMbo.getString("BUACCESSTEXT"), 11L)
This script retrieves the person record associated with the "reportedby" attribute of the work order and copies the values of "BUACCESS" and "BUACCESSTEXT" from the person record to the work order.
- Save the script and close the Automation Scripts application.
Now, whenever a new work order is created, the values of "BUACCESS" and "BUACCESSTEXT" will be copied from the associated person record to the work order.
------------------------------
===============================
Craig Kokay,
Lead Senior Maximo/IoT Consultant
ISW
Sydney, NSW, Australia
Ph: 0411-682-040
=================================
#IBMChampion2022
------------------------------
Original Message:
Sent: Mon July 17, 2023 08:21 AM
From: mx pro
Subject: Crossover information from WO creator to WO
Hi Craig,
As I mentioned in my original request that the requirement is to fill the data at time when user clicks on "New Workorder" button.
Thanks
------------------------------
mx pro
ON
Original Message:
Sent: Mon July 17, 2023 01:02 AM
From: Craig Kokay
Subject: Crossover information from WO creator to WO
Hi Mx Pro
There are a number of crossover domains already in place such as WO2WO, WO2TCKT, LOC2WO, and ASSET2WO.
You just need to add additional fields to the domain that will meet your criteria.
Simple.
------------------------------
===============================
Craig Kokay,
Lead Senior Maximo/IoT Consultant
ISW
Sydney, NSW, Australia
Ph: 0411-682-040
=================================
#IBMChampion2022
Original Message:
Sent: Fri July 14, 2023 05:27 PM
From: mx pro
Subject: Crossover information from WO creator to WO
Hello,
We have two custom fields created in WORKORDER and PERSON object
those fields are BUACCESS and BUACCESSTEXT
What we need is that at time of WO creation (and also when a user create WO either as a follow up WO, or when user create WO from other applications, for example from SR or Asset), these two fields should be crossed over from the WO Creator Record to the WO.
We need to have this done using Automation script and not using crossover domain
Can someone help step by step... including the script?
Thanks in advance
------------------------------
mx pro
ON
------------------------------