Refresh & Save MBO on Custom Dialog w/o DialogOk event
Prashant Sharma
IBM Champion 2025-2024-2023-2022 ?? | ?? GenAI ?? IBM Maximo (M4/5/6/7.X & MAS) - CMMS & APM & Mobile | ?? 1xGCP-1xAzure-1xOCI | ?? XLRI ?? CSM? ??
Select Action and Buttons are popular controls in Maximo. There is an OOB event "DialogOk" available which can be used to close the dialog and save the changes on MBO. But many times there is a need for us to create a custom action or button which will work with a dialog window. The user will provide input on this dialog box and the UI needs to be refreshed to show the updates after it. There might also be a requirement to do some processing before Save is called and hence OOB DialogOK event can't be used.
#To Close Dialog?and Mark parent to modified=True which internally calls to refresh UI?OOB event. Create an action script and associate it with the button on the dialog. On clicking this button, this action script will be called.
owner = mbo.getOwner()?
if(owner is not None):?
? ??
owner.setModified(True)
service.closeDialog()?
Service and related methods are not available on old versions of Maximo so it will be recommended to at least have Maximo 7.6.1.2 in case you want to take advantage of this method on automation scripts.
#To Save the record after Closing the Dialog?and setting parent to modified=True.
owner = mbo.getOwner()?
if(owner is not None):????
owner.setModified(True)
service.closeDialog()
mbo.getThisMboSet().save()?
The calling of Save() method should be handled as per MBO Customization's Best Practices.
MAS8 || EAM || GENERATIVE AI || Maximo Advisory Consultant || AI/ML Enthusiastic || Supply Chain || EAM || LANGGRAPH || CrewAI || AWS || Project Management || Integration Architect || Father
2 年Good post. Before the introduction of service handler, same has been done through two scripts, 1. invoking initialise event on custom dialog mbo (where parent can be set modified to true) and 2.setting the custom logic in the before save of parent mbo.