Hi Paul,
IMHO the logic you're trying to implement does not fit Object[SAVE] launch point but should rather be implemented in form of at least Attribute[ACTION] to set related attributes (non-)required depending on current PAYBYPCARD
state, preferably complemented with Attribute[INIT] to do the same as Attribute[ACTION] but at the time of record init.
When you do it on Object[SAVE] then this is already too late so what you eventually can get is actually to enforce data validation (you will not be able to save without required attr. values) but you will never get it reflected properly on the UI.
------------------------------
Andrzej Więcław
Maximo Technical Consultant
AFRY
Wrocław, Poland
------------------------------
Original Message:
Sent: Mon November 18, 2024 02:54 PM
From: Paul Bishop
Subject: Issue with automation scripting
This is a python script.
In the workorder table I created a field called PAYBYCARD and it is defined in Maximo as a yes/no field
When a workorder is saved, I need that field to be evaluated to see if it has been checked. If it has been checked I need workorder to require 3 other fields to be filled out.
Python script
#PAIDBYPCARD SCRIPT
if PAYBYPCARD == 1:
PCARDAMOUMT=True
PCARDHOLDER=True
PCARDPAIDDATE=True
When I activate the script and save a workorder with the box checked, it give me a java boolean evaluation error
------------------------------
Paul Bishop
------------------------------