****Maximo Make MEMO filed required during status change****
Below I am outlining simple maximo solution when you have requirement to make the "memo" field required when status being changed to a specific value.
Actually this requirement may not be done using conditional UI.
We need to use automation script or java code in order to achieve this requirement.
Below is automation script approach to provide solution for this requirement.
Requirement : Make the memo field required when work order status is being changed to "Approved" in changed status dialog.
GoTo-> Automation Scripts ->Create script with Attribute Launch Point.
LaunchPoint - WOCHGSTATUS
Description : Memo field required for Approving Work Orders
Object : WOCHANGESTATUS
Attribute : STATUS
Events : Run Action
Create Below Launch point variables :
vSTATUS INOUT Override , Binding : STATUS
vMEMO INOUT Override , Binding : MEMO
Now use below script code (Python)
#########################################################################################################################################################################
#
# Version Date Author Request # Remarks
# 1.0 1/10/2019 Prashant Bavane Make MEMO field required WO status being changed to APPR
#
#########################################################################################################################################################################
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
Create/Save the script.
Now we will test this solution.
GoTo - Work Order Tracking application , open WO record having WAPPR status.
Click "Change Status" button/select action.
Then , you can get "Change Status Dialog.
Select "Approved" status from dropdown list for New Status field
Now click OK button without entering any value for Memo field.
You will get error as below :
Cheers!!!
Below I am outlining simple maximo solution when you have requirement to make the "memo" field required when status being changed to a specific value.
Actually this requirement may not be done using conditional UI.
We need to use automation script or java code in order to achieve this requirement.
Below is automation script approach to provide solution for this requirement.
Requirement : Make the memo field required when work order status is being changed to "Approved" in changed status dialog.
GoTo-> Automation Scripts ->Create script with Attribute Launch Point.
LaunchPoint - WOCHGSTATUS
Description : Memo field required for Approving Work Orders
Object : WOCHANGESTATUS
Attribute : STATUS
Events : Run Action
Create Below Launch point variables :
vSTATUS INOUT Override , Binding : STATUS
vMEMO INOUT Override , Binding : MEMO
Now use below script code (Python)
#########################################################################################################################################################################
#
# Version Date Author Request # Remarks
# 1.0 1/10/2019 Prashant Bavane Make MEMO field required WO status being changed to APPR
#
#########################################################################################################################################################################
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
Create/Save the script.
Now we will test this solution.
GoTo - Work Order Tracking application , open WO record having WAPPR status.
Click "Change Status" button/select action.
Then , you can get "Change Status Dialog.
Select "Approved" status from dropdown list for New Status field
Now click OK button without entering any value for Memo field.
You will get error as below :
Cheers!!!
1 comment:
Thanks for detailed article on this scenario. Helpful for many use cases.
Post a Comment