Maximo Open Forum

 View Only

 Dynamic Field Based on Checkboxes

  • Customizations
Toni Fields's profile image
Toni Fields posted 04-06-2023 09:23

Hi! I apologize in advance if this question has been asked before. First of all, I am relatively new to Maximo and to automation scripting.

I am trying to create a non-persistent, dynamic field that will update every time a checkbox is checked for a record within a table. This dynamic field will be a calculated field based on information contained within all records that have a checked checkbox. Basically, I want to sum up the line cost for each record that has been checked and display the total in a separate field. The field should update as more checkboxes are checked.

I have tried to implement this using an attribute launch point automation script, but I don't know how to update the UI to show the newly set value. I thought that maybe I can use the web client session to update the field via the control id, but I only know how to set the visibility this way and not how to render it into the field for the user to view.

Any help that you can provide to assist would be greatly appreciated. Thanks!

Subhransu Sekhar Sahoo's profile image
Subhransu Sekhar Sahoo

Hi Toni,

Where is your automation script launch point?  It should be on the "Initialize Value" option of Non-persistent attribute. 

So Basically Create an attribute launch point automation script on the Initialize Value event of the Non-Persistent attribute. Add your logic to calculate the sum of line cost based on the check box value and set it to the Non-persistent attribute inside the script.

Now once the script is set, Go to that application designer in maximo and expose the checkbox at line level of your application. Once the configuration is done, Go to the application add a new line and check the checkbox and provide a line cost. As soon as the line cost is provided, the autoscript should get trigger and value will be calculated and set on the non-persistent dynamic field.


Toni Fields's profile image
Toni Fields

Subhransu,

I have the launch point set to the checkbox attribute, which is a non-persistent attribute. I currently have it set to run action, but I will try setting it to initialize value instead. I'll let you know if it works. Thanks!

Toni Fields's profile image
Toni Fields

Subhransu,

I know that it's been a while. I did try what you suggested, but it didn't fully work like I wanted it to. I did get it working to show on the screen by using something similar to the below code though.

wcs = service.webclientsession()
control = wcs.findControl('mytablescontrolid')
if control is not None:
      data = control.getDataBean()
      if data is not None:
            data.reset()
currentMboSet = mbo.getThisMboSet().reset()

Thank you for all your help.