IBM Support

Forcing Site and Organization entry in Job Plans app before save.

Technical Blog Post


Forcing Site and Organization entry in Job Plans app before save.


In Job Plans app, when you create a new job plan, the org id and site id will become greyed out (ready only) if you attached an attached document first before you fill
in the org id and site id.  


How to fix it so the org id and site id will not be ready only when you attach a document before saving record?


Steps to replicate :
1. Open Maximo logged as maxadmin
2. Go to Job Plans app
3. Insert a new record, and leave the Orgarnization and Site fields blank
4. Attach a new document on this new record, without saving
5. After the document has been attached, try to edit Organization and Site fields

The fields will be read-only, just like if you had saved the record.


It seems that the Attach Document action fires a save event on the record and this is why the fields become read-only.


This behavior is not a bug in Maximo and is working as designed. The record is saved before any of the Attachments dialogs can launch.

But there is some workaround that you can try, based on a condition. You have to be sure about this : Do you have or would you ever have any system-level (null siteid and null orgid) or organization-level (null siteid, non-null orgid) job plans?

If all of your job plans are site-level and can only be site-level, you can apply a workaround. However, the workaround won't work if you have job plans at different levels (site,org, and system)


The following autoscript will force entry of orgid and siteid on a new job plan before the record can be saved directly or by clicking on any of the Attachments or other dialogs that might force a save before loading.


Make sure after creating the script that the 'Active' checkbox is checked on the Launch Points tab in the Launch Points table window. This is different than the 'Active' checkbox on the Automation Script tab.

Also, the server does not have to be restarted after creating the script. Once the script is saved and active, the error should be thrown whenever an attempt is made to save a job plan with a null siteid or orgid.


The Souce Code is pasted below the "Create Script with Object Launch Point "


#Source Code: Begin
from psdi.iface.mic import MicUtil
from java.lang import Exception
from psdi.mbo import MboConstants
from import InventoryRemote
from psdi.util import MXRequiredFieldException

MicUtil.INTEGRATIONLOGGER.debug("86316,227,000****START " + launchPoint)
if mbo.toBeAdded() and mbo.isBasedOn("JOBPLAN"):
if mbo.isNull("siteid"):
params = ["SITEID", "JOBPLAN"]
errorgroup = "system"
errorkey = "null"

if mbo.isNull("orgid"):
params = ["ORGID", "JOBPLAN"]
errorgroup = "system"
errorkey = "null"

MicUtil.INTEGRATIONLOGGER.debug("86316,227,000****END " + launchPoint + "**********************************************************************")
#Source Code: End

Good luck...


[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]