Maximo

 View Only

Change UI controls properties using automation script

  • 1.  Change UI controls properties using automation script

    Posted Thu March 31, 2022 05:35 AM
    Hello Everyone,


    I was wondering if there is a way to do the conditional formatting on the UI using automation script.
    The general idea is changing field's label based on selected values from other fields.
    I have found a way to do this but with some drawbacks. I was able to change the label using a script with attribute launchpoint on "Validation" the following code:

    from psdi.common.context import UIContext
    from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent
    attr1=service.webclientsession().getControlInstance("1641902333825")
    attr1.setProperty("label","Test Change Label")

    where "1641902333825" is the control ID from application designer.
    It actually changes the label of the control but the drawback is as long as i am in this instance, the label for this control will always be "Test Change Label".
    So if the label changes, the label will always be "Test Change Label" even if i do the following:
    1. Go to list view and open another record
    2. Click the next record
    3. Create a new record
    The only way to get the label to reset again is to go to start center and reopen the application.

    Is there a way to go around this, like maybe make the change only affect the current page, or make the control refresh or rerender itself to its original form?

    ------------------------------
    Mahmoud Hossam
    ------------------------------



    #AssetandFacilitiesManagement
    #MaximoIntegrationandScripting
    #Maximo