Automation Script : How to make memo field required depending on status to be changed
Rhong 270000CPG9 Comments (8) Visits (19565)
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.
Launch Point name : any name
Object : WOCHANGESTATUS
Attribute : STATUS
- Click Next Button.
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
- 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.
If you change 'New Status' to other status such as Completed, Memo field won't be required.