Maximo Open Forum

 View Only
  • 1.  setFieldFlag function not working on Automation scripts?

    Posted 02-15-2022 05:13
    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 ?
    Script Details
    Launch Point Details
    Asset DetailsAsset Description not becoming readonly

    #Customizations

    ------------------------------
    Keshav Ravindran
    Bct
    ------------------------------


  • 2.  RE: setFieldFlag function not working on Automation scripts?

    Posted 02-15-2022 09:08
    Hi Keshav, 

    What is the exact requirement?

    Thanks, 


    ------------------------------
    Pavan Uppalanchu
    Abc
    ------------------------------



  • 3.  RE: setFieldFlag function not working on Automation scripts?

    Posted 02-15-2022 14:44

    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
    ------------------------------