Maximo Open Forum

 View Only
  • 1.  How to set everything READ ONLY for a record but still leaving specific fields and functions editable?

    Posted 12-21-2022 10:53
    Hi All, 

    We are using Maximo 7.6.1. Currently we have an automation script which uses method "setFlag" to set everything of "Location" object as "READONLY". 
    Method "setFlag":

    Current Script:

    Current Result:

    Now we want to have some specific fields and functions such as "Attahchments" to be editable at the same time. So we tried to use method "setFieldFlag" to set all fields as READONLY, but except for "Description". However, it leaves not just "Description" editable, but other tabs and relationship or non-persistent fields editable as well.
    Method "setFieldFlag":

    New Script:

    New Result: (Grey line indicates READONLY; Black line indicates editable)


    Does anyone know a way we can restrict everything of a mbo as READONLY, but still leaving specific field and/or function available? In our real request, we need to have the "Attachments" editable. But it seems more difficult than a regular field.

    Thanks very much,

    Frank Meng
    #Customizations
    #WorkManagement

    ------------------------------
    Frank Meng
    City of Oshawa
    ------------------------------


  • 2.  RE: How to set everything READ ONLY for a record but still leaving specific fields and functions editable?

    Posted 12-21-2022 11:37

    For core out of the box objects like Locations I don't think this is possible with an automation script. If you make the object read-only, all the child objects are automatically read-only and I don't think there's a way to change it even if you tried something like:

    doclinkSet=mbo.getMboSet("DOCLINKS")
    doclinkSet.setFlag(mbo.READONLY,False)

    The way you did the field level is technically correct and would work for custom objects, but the initFieldFlagsOnMbo in the java class will fire after init and overrides anything you had set.

    I think you would need to extend the Locations class with your own initFieldFlagsOnMbo method. Call super.initFieldFlagsOnMbo() and then implement your own logic to make every field but 1 read-only. Then all the child objects (such as DOCLINKS) would be editable. You would need to make any other child object read-only that you don't want the user to modify (such as specifications). 

    Another option is you create a new application and set each of the sections (except the one with attachments) input mode to be read-only. Then in your script, make it so it ignores that application. You'll be dependent on someone not messing up the application in the future but that's the only way I can think of doing it without custom java. 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 3.  RE: How to set everything READ ONLY for a record but still leaving specific fields and functions editable?

    Posted 12-21-2022 12:27
    Thanks Steven! You always got the answer for us.

    ------------------------------
    Frank Meng
    City of Oshawa
    ------------------------------