Interesting. Good to know!
Original Message:
Sent: 06-16-2023 09:02
From: Jade Warren
Subject: Duplicating a Job Plan (Site field is READONLY)
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
Original Message:
Sent: 06-16-2023 08:57
From: Alex Walter
Subject: Duplicating a Job Plan (Site field is READONLY)
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 recorddupmbo.setFieldFlag("SITEID", MboConstants.READONLY, False) ## undo read-onlydupmbo.setFieldFlag("SITEID", MboConstants.REQUIRED, True) ## make required
Hope this helps,
------------------------------
Alex Walter
A3J Group, LLC
Original Message:
Sent: 06-15-2023 09:52
From: Jade Warren
Subject: Duplicating a Job Plan (Site field is READONLY)
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
Original Message:
Sent: 10-17-2022 06:49
From: Devendra Verma
Subject: Duplicating a Job Plan (Site field is READONLY)
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
------------------------------