Maximo Open Forum

 View Only
  • 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
    ------------------------------