Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Crossover information from WO creator to WO

    Posted Fri July 14, 2023 05:27 PM

    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
    ------------------------------


  • 2.  RE: Crossover information from WO creator to WO

    Posted Mon July 17, 2023 01:03 AM

    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
    ------------------------------



  • 3.  RE: Crossover information from WO creator to WO

    Posted Mon July 17, 2023 08:22 AM

    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
    ------------------------------



  • 4.  RE: Crossover information from WO creator to WO

    Posted Mon July 17, 2023 03:13 PM

    Hi Mx Pro,

    As Craig mentioned the crossover domains to make this kind of data movement take place.  That is the "usual and best practice" when invoking a follow up work order form Asset, Loc, SR or WO. To include info from the Person record will take a bit more and likely an Auto script.  That said you mention several things that I am unclear on:

    1. " two custom fields created in WORKORDER and PERSON object those fields are BUACCESS and BUACCESSTEXT"  is one attribute on WO and one on PERSON?
    2. "we need is that at time of WO creation (....), these two fields should be crossed over from the WO Creator Record to the WO."  What is the WO Creator Record?  PERSON?  If so what does the previous statement in item one mean?  Please clarify.
    3. "We need to have this done using Automation script and not using crossover domain" can you explain the imperative?  Why MUST this be an auto script?


    ------------------------------
    Bradley K. Downing , MBA
    Senior Brand Technical Specialist
    IBM
    Bakersfield CA
    ------------------------------



  • 5.  RE: Crossover information from WO creator to WO

    Posted Mon July 17, 2023 09:17 PM
    1. Log in to Maximo with administrative privileges.

    2. Navigate to the "Automation Scripts" application.

    3. Click on the "New Script" button to create a new script.

    4. Provide a name for the script, such as "CopyFieldsFromPersonToWO."

    5. In the "Object" field, select "WORKORDER" from the dropdown menu.

    6. In the "Attribute" field, select "add" and enter "BUACCESS" as the attribute name.

    7. In the "Attribute" field, select "add" again and enter "BUACCESSTEXT" as the attribute name.

    8. In the "Launch Point" section, select "Create" from the dropdown menu to trigger the script when a new work order is created.

    9. 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.

    1. 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
    ------------------------------