Maximo Open Forum

 View Only
Expand all | Collapse all

Duplicating a Job Plan (Site field is READONLY)

  • 1.  Duplicating a Job Plan (Site field is READONLY)

    Posted 10-17-2022 06:50
    Hello Everyone,

    We are trying to duplicate the job plans from an existing site to the new site that we are adding to our Maximo environment. We see the site field is READONLY when we try duplicating the job plans and cannot change the siteid field to the new site name. Is it the default behavior of the Job Plan application in Maximo? Is there a way to make the siteid field read-write enabled while duplicating the plans.
    Currently, we are on the 7.6.1 version.
    #EverythingMaximo

    ------------------------------
    Devendra Verma
    SenecaGlobal
    ------------------------------


  • 2.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 10-17-2022 10:14
    Hello - Duplicating or Revising Job Plan doesn't allow editing of Site ID and Org ID.

    Have you tried updating record with MXLoader?

    ------------------------------
    Prashant Sharma
    Sedin Technologies
    Connect with me @ https://www.linkedin.com/in/psharmamaximo/

    #IBM Champion 2022
    ------------------------------



  • 3.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 06-15-2023 09:53

    One of our users asked about this this morning.  To provide the capability, did the following:

    In Application Designer > Job Plans:

    • add a signature option JP_DUP with the "UI action" flag set.
    • update Select Action menu to replace the DUPLICATE option with JP_DUP

    In Security Groups:

    • Locate an appropriate security group (for testing, EVERYONE works usually) and grant the JP_DUP signature option for Job Plans

    In Automation Scripts:

    • Create an Action launch point JP_DUP and associate with a script JP_DUP
    • Set the script code as follows:

    from psdi.mbo import MboConstants;

    ## get context
    session = service.webclientsession(); ## we need the session so we can get the app bean
    appbean = session.getCurrentApp().getAppBean(); ## get the app bean

    appbean.DUPLICATE(); ## call the DUPLICATE function as if the user would have

    ## after DUPLICATE, the screen is displaying the "new" job plan
    mbo = appbean.getMbo(); ## pull that into 'mbo'
    mbo.setFieldFlag("SITEID", MboConstants.READONLY, False); ## undo read-only
    mbo.setFieldFlag("SITEID", MboConstants.REQUIRED, True);  ## make sure required is shown

    Finally:

    • Sign off / sign on (new security grants take effect)
    • Test


    ------------------------------
    Jade Warren
    Great River Energy
    ------------------------------



  • 4.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 06-16-2023 08:58

    Nice solution Jade!

    There's also a way to do this without having to modify the menu options. If you create your automation script with the OBJECT.DUPLICATE name (in your case JOBPLAN.DUPLICATE), Maximo will automatically fire the script whenever a Job Plan is duplicated. Within the script there will be two implicit variables: 1) mbo, which represents the record being copied, and 2) dupmbo, which represents the newly copied record. You should then be able to trim the script down to something like:

    from psdi.mbo import MboConstants
    
    ## after DUPLICATE, dupmbo represents new record
    dupmbo.setFieldFlag("SITEID", MboConstants.READONLY, False)  ## undo read-only
    dupmbo.setFieldFlag("SITEID", MboConstants.REQUIRED, True)   ## make required

    Hope this helps,



    ------------------------------
    Alex Walter
    A3J Group, LLC
    ------------------------------



  • 5.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 06-16-2023 09:02

    Hi Alex!

    I did try the JOBPLAN.DUPLICATE approach first because it is far more elegant--but for reasons unknown to me, the screen did NOT refresh (i.e. the Site field remained read-only).

    :o) Jade



    ------------------------------
    Jade Warren
    Great River Energy
    ------------------------------



  • 6.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 06-16-2023 09:26

    Interesting. Good to know!



    ------------------------------
    Alex Walter
    A3J Group, LLC
    ------------------------------



  • 7.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 06-17-2023 03:25

    Hi Jade,

    Thanks for the solution. Will try it out in our environment. So far, we were uploading the plans through MxLoader but with your solution, it is going to be much easy.

    Thanks!!



    ------------------------------
    Devendra Verma
    SenecaGlobal
    ------------------------------



  • 8.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 08-13-2026 07:34

    Was looking for something like this, thanks Jade.

    One point is that we need to set the flag for ORGID as well, as this gets updated when you select a new site. 

    But other than that, works a treat. 

    Also tried the OBJECT>DUPLICATE method, but fields remained read-only. 



    ------------------------------
    Dirkjan van Rooy
    Naviam
    ------------------------------



  • 9.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 08-14-2026 15:32
    Edited by FREDRICK NDWARU 08-14-2026 15:42

    Job Plans are the most complex functional area. If you override business rules, you will break Job Plans for your instance—a mess you do not need to deal with ever.

    Job Plans are defined at the Set, Org, and Site, I believe. If a job is not defined at the site level, duplicate the Job Plan and assign a site ID to revision 0. This solves your issue forever.

    In Maximo: 

    If a Job Plan has a site ID, it's a site-level record. 

    If a Job Plan does not have a site ID but has an Org ID, It's an Org-level record. 

    If a Job Plan does not have a site ID or an Org ID, it's a Set-level record. 

    Adding a site ID to an organization-level Job Plan violates business rules due to misalignment, causing the misclassified record to remain in that state for its lifetime until the correct business process to remediate the violation is executed. 

    It's better to err on the side of caution.

    Best,
    ------------------------------
    Fredrick Ndwaru
    Perpetual Ignition
    ------------------------------



  • 10.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 28 days ago

    Job plans are complex and the risk of duplicating and changing the site are all the child/related records that are also tied to the site.  If the job plan has materials related to a storeroom, changing the site on the duplicate version can impact that.  Similarly duplicating job plans across organizations can impact associated labor records.  It is possible, but you do need to make sure any scripting that is allowing for change of org or site on the new record properly accounts for updating any related records as well.  We built a custom action that allows users to copy a job plan to their site; in that instance it allows them to find an existing job plan, copy it setting the site id to their default insert site, and then checks all child records and removes/updates as needed to maintain data integrity.

    Amy



    ------------------------------
    Amy Tatum
    Starboard Consulting LLC
    ------------------------------



  • 11.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 28 days ago

    I totally agree with Amy and Fredrick. There is so many related data to a Site specific Jobplan which can become inconsistent if you manage to change the SiteID on the duplicate. Having had the requirement of copying existing Jobplans into a new site quite some time ago, I was thinking about a loopback interface concept:

    1. Add a non-persistent Field "NEWSITE" to the Jobplan Object, make it available somewhere in a dialog (to manage permissions)
    2. An Action triggers a Publish Channel with the content of the Current Jobplan
    3. A xslt replaces the SITEID on the generated XML with the value provided in the non-persistent "NEWSITE"
    4. The resulting xml will be processed by an Enterprise Service. If this Enterprise service is able to "digest" the XML - the data is fine, if not it fails for a reason, but it won't create inconsistencies.

    Just as an idea/approach for a technical solution, if entering the duplicate manually isn't reasonable.



    ------------------------------
    Johann Rumpl
    Naviam
    ------------------------------



  • 12.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 28 days ago

    Agree with all of the above, for duplicating and actual Job Plan, the risk is too high. 

    In our instance, the Job Plan object was repurposed for another feature, with limited child objects, all of which are site and org independant. 

    We validated that all child objects save with the new and correct SITE and ORGID values.

    For duplicating an actual Job Plan, much more care should be taken



    ------------------------------
    Dirkjan van Rooy
    Naviam
    ------------------------------



  • 13.  RE: Duplicating a Job Plan (Site field is READONLY)

    Posted 28 days ago
    Edited by FREDRICK NDWARU 28 days ago

    I created the SQL Server Query below as a tool to fetch the Job-Plan-Related data needed to understand your unique use case. 

    1. Query No.1: MAXIMO DATA DICTIONARY ATTRIBUTE QUERY -  Use this query to identify the related Job Plan records. OOB, the Job Plan's Unique ID is the JOBPLANID. OOB, Maximo uses the SAMEASOBJECT and SAMEASATTRIBUTE for validation. 
    2. Query No.2: QUERY TO IDENTIFY JOB PLAN MAXIMO INTERNAL DB CONFIG SETORGSITE FOR UNIQUE JOB PLAN RECORDS - Use this query to identify the internal Maximo record site-orgType: System, Set, Organization, or Site Level.

    Please see a screenshot of the Max Demo Database SQL Server example below:

    /************************************************************************************************************
    Query No.1: MAXIMO DATA DICTIONARY ATTRIBUTE QUERY
    Version: SQL Server - Optimized / Read-Only
    Purpose:
    - Return Maximo data dictionary details for a specific service, object attribute, and OOB status.
    - Optimized by replacing repeated scalar subqueries with joins.
    - JOBPLANID USECASE
    ************************************************************************************************************/
    SELECT DISTINCT
        mo.servicename AS [Maximo Servicename],
        mac.objectname AS [Maximo Object],
        mo.description AS [Object Description],
        CASE
            WHEN mo.userdefined = 1 THEN 'User Defined Object'
            WHEN mo.userdefined = 0 THEN 'OOB Object'
        END AS [Is Maximo Object OOB or User Defined?],
        mac.attributename AS [Maximo Attribute],
        mac.attributeno AS [Attribute No],
    mo.siteorgtype AS [Maximo Internal SETORGSITE Type],
        mac.maxtype AS [Data Type],
        mac.length AS [Attribute Length],
        mac.title AS [Attribute Title],
        CASE
            WHEN mac.userdefined = 1 THEN 'User Defined Attribute'
            WHEN mac.userdefined = 0 THEN 'OOB Attribute'
        END AS [Is Maximo Attribute OOB or User Defined?],
        mac.remarks AS [Attribute Description],
        mac.sameasobject AS [Same as Maximo Object],
        mac.sameasattribute AS [Same As Object Attribute]
    FROM maxattributecfg mac
    INNER JOIN maxobjectcfg mo
        ON mo.objectname = mac.objectname
    INNER JOIN maxservice ms
        ON ms.servicename = mo.servicename
    WHERE mo.servicename = 'JOBPLAN'
        AND mac.attributename = 'JOBPLANID'
        AND mac.userdefined = 0
        AND mo.userdefined = 0
    ORDER BY
        mac.objectname,
        mac.attributename;
    --
    -----------------------------------------------------------------------------------------------
    --
    -- QUERY No. 2: IDENTIFY JOB PLAN SETORGSITE TYPE
    -- QUERY TO IDENTIFY JOB PLAN MAXIMO INTERNAL DB CONFIG SETORGSITE FOR UNIQUE JOB PLAN RECORDS
    --
    -----------------------------------------------------------------------------------------------
    SELECT
        jp.JPNUM,
        jp.DESCRIPTION,
        jp.pluscrevnum AS [REVISION NUMBER],
    CASE 
    WHEN (JP.SITEID IS NOT NULL AND JP.ORGID IS NOT NULL) THEN 'SITE-LEVEL JOBPLAN'
    WHEN (JP.SITEID IS NULL AND JP.ORGID IS NOT NULL) THEN 'ORG-LEVEL JOBPLAN'
    WHEN (JP.SITEID IS NULL AND  JP.ORGID IS NULL) THEN 'SET-LEVEL JOPBLAN'
    END AS 'ORIGINAL JOB PLAN LEVEL' ,
        jp.SITEID,
        jp.ORGID,
        jp.STATUS,
        jp.JOBPLANID
    FROM (
        SELECT
            JOBPLAN.JPNUM,
            JOBPLAN.DESCRIPTION,
            JOBPLAN.pluscrevnum,
            JOBPLAN.SITEID,
            JOBPLAN.ORGID,
            JOBPLAN.STATUS,
            JOBPLAN.JOBPLANID,
            ROW_NUMBER() OVER (
                PARTITION BY JOBPLAN.JPNUM
                ORDER BY JOBPLAN.JOBPLANID
            ) AS rn
        FROM JOBPLAN
    ) jp
    WHERE jp.rn = 1
    ORDER BY
        jp.JOBPLANID,
        jp.JPNUM;



    ------------------------------
    Fredrick Ndwaru
    Perpetual Ignition
    ------------------------------



Newest Episode
Ep. 6 | Automation Script Do’s and Don’ts in IBM Maximo

Watch Steven Shull share practical do’s and don’ts for using automation scripts in IBM Maximo, including when scripts make sense, what to avoid, and how to keep them simple, tested, documented, and supportable.

MORE by Naviam Episode 6 cover
Watch Episode 6
Also available: Ep. 5 | Make Manage Feel Like Home with Configuration, Not Customization