Maximo Open Forum

 View Only
  • 1.  Automation Script with NON PERSISTENT Object

    Posted 05-24-2020 01:38
    Can automation script Retrieve List event be used on a NON- Persistent field. 

    I am trying to filter out the values that are displayed on the POCHANGESTATUS.STATUS field conditionally and I cant get it to work. So i just had a very simple logic in my script as below:

    domainid="POSTATUS"
    listWhere = "orgid is not null"

    Nothing shows up on the drop down menu on the change status dialog in the PO application. 

    I am not sure if anything is wrong with the code or is it more like an issue with the event not able to work with the non persistent field?

    Has anyone had a similar issue before ?

    Any input is greatly appreciated.

    Thank You.
    #Customizations

    ------------------------------
    Vikky
    Idyllic Solutions
    ------------------------------


  • 2.  RE: Automation Script with NON PERSISTENT Object

    Posted 05-25-2020 10:13

    To the best of my knowledge, we've never tried to adjust the status list because each object has a subset of allowed statuses based on its current state. Trying to replicate that is risky and could cause issues down the road (though hopefully here it would be caught when it made it down to the actual PO status in this case). Depending on what you're trying to do, we would accomplish this one of two other ways. 

    Most often we create an attribute validate method on PO.STATUS. There are some situations in Maximo where a status is just hidden. A good example is if the user doesn't have permission to initiate a work order (make in progress), they can't complete a work order that hasn't been initiated. The COMP status is just missing on that work order, but other work orders they can change to complete and it's confusing to the end users. We prefer descript error messages that explain why that particular status change isn't allowed so the user understands how to proceed. This is our recommended approach (if if it's conditional). We also use PO.STATUS here because the POCHANGESTATUS can be done from the list tab impacting many records and we want to ensure that check is processed on all of the records.

    The other option is we would apply a condition to values on POSTATUS domain to hide when we want to hide those values (especially ones that are always hidden with conditions like 1=2). This is useful when you have a legacy value that you have to keep because you have records that were in those statuses, but don't want people to use moving forward. 



    ------------------------------
    Steven Shull
    Projetech
    ------------------------------



  • 3.  RE: Automation Script with NON PERSISTENT Object

    Posted 05-26-2020 05:30
    Hi Vikky,

    Steven Shull has given the best possible solution. So, I believe you should try and use that solution for your use case.

    I would shed some light on the use of retrieve script scenario you have mentioned. You can do a retrieve list on the non-persistent attribute but there is no need of using script of doing so in your mentioned scenario. Simple domain application can be used to achieve whatever you are trying to do( Steven has already explained how).
    Retrieve Scripts should be used if you really have a complex scenario where you want to use 2 different domains in the same field based on condition. So, unless you have real difficult situation which would have been possible only by java class then you can think of using a autoscript. 
    One scenario I can think of is:  Based on the calculation of priority you might have to display values from 2 different domains. So, you would need to do the priority calculation in the script and then based on the output using  if else clause you can set a domainid for the field. Also, please do check if you are using the write lookup xml.

    Hope this helps.

    Thanks,
    Biplab


    ------------------------------
    Biplab Choudhury
    Tata Consultancy Services
    ------------------------------