Attribute restrictions shouldn't be set utilizing object save scripts. The record gets reinitialized after save so the restriction (read-only/required) is removed from the attribute since the Maximo framework doesn't know that the attribute should be read-only/required anymore. This reinitialization is done as the Maximo framework has to change editability of a lot of different fields based on certain changes. For example, once a PO is approved most of the fields have to be marked as read-only. Instead of having to handle it during the status change and during initialization (since someone could open a PO from the list tab), the object is reinitialized after save to re-evaluate the rules.
If it absolutely must be an automation script, you could set the field flags with an Object Initialize automation script. In general, I recommend utilizing a Global Data Restriction on the attribute instead and writing a condition. That condition could be an automation script if necessary but most of the time you're able to do it with just a SQL expression. Global Data Restrictions are configured in the Security Groups application.
------------------------------
Steven Shull
IBM
------------------------------
Original Message:
Sent: 02-15-2022 05:12
From: Keshav Ravindran
Subject: setFieldFlag function not working on Automation scripts?
When the automation script is created for Object Launch Point Save(Before Save) and the Add and update check box are checked, the setFieldFlag (Required or Readonly) do not work itself.
Attached the screenshot.
Is there anything that I am doing wrong or is there an alternate solution for this ?
#Customizations
------------------------------
Keshav Ravindran
Bct
------------------------------