IBM Support

Automation Script : How to make memo field required depending on status to be changed

Technical Blog Post


Abstract

Automation Script : How to make memo field required depending on status to be changed

Body

Do you have a requirement to make the memo field required when status is gonna be changed to specific status?

Actually, your requirment may not be done using conditional UI setting.

You may need to use automization script or java code in order to achieve your requirement.

 

You can reference below automation script example.

 The requirment :  make the memo field required when status is gonna be changed to 'Approved'  in the Change Status Dialog.

- Go to the Automation Scripts  - Select Action /  Create script with Attribute Launch Point.

image

 

Launch Point name :  any name

Object : WOCHANGESTATUS

Attribute : STATUS

 

- Click  Next Button.

image

 

Set Scrpt Name and Script Language as jython.

Then, add two variables  ( vSTATUS , vMEMO) for STATUS , MEMO attribute.

 

- Click  Next Button. In source code,  add the codes followings :

 

from psdi.mbo import MboConstants
from psdi.server import MXServer

if  MXServer.getMXServer().getMaximoDD().getTranslator().toInternalString("WOSTATUS",vSTATUS, mbo) == 'APPR' :
   vMEMO_required = True   
else :
   vMEMO_required = False

 

Save

- change Status to Active.

 

- Now, go to  the Work Order Tracking application - Open a WO having WAPPR status.

- Click 'Change Status' button. Then, you can get 'Change Status' dialog.

 

If you change 'New Status' to Approved,  Memo field will be required.

image

If you change 'New Status' to other status such as Completed,   Memo field won't be required.

 

image

Thanks,

 

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11130505