IBM Support

Marking Main Record as Modified while Modifying Related (Child) Records via Automation Scripts (v7.6)

Technical Blog Post


Abstract

Marking Main Record as Modified while Modifying Related (Child) Records via Automation Scripts (v7.6)

Body

When you modify, i.e. add/update/delete, child records (MBOs) related to a main record, the parent object might not always require saving, in other words it might not always get marked as "Modified". For default applications, the application forces the user to SAVE the main record because this functionality is implemented in the original MBO classes of Maximo. Unfortunately, when you have your custom objects used in your custom applications, you can face such use cases that you modify the child records and the main record is not affected by this modification. Here, I present a simple solution implemented using Automation Scripts:

Create an Object Level Automation Script for your child object with any modification option(s). I have selected Delete option of SAVE event for this example on version 7.6 seen below:

image

The tiny code piece for the python script is as follows:

  owner = mbo.getOwner()  if(owner is not None):      owner.setModified(True)  

We are done, in this example when you delete a child record its main record will notice that there is a modification.

[{"Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"ARM Category":[{"code":"a8m0z000000bo4vAAA","label":"Assets"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Type":"MASTER"}]

UID

ibm11130199