Generalized background--I have a Maximo application definition that contains a defined data source src_child and a defined dialog box dialog_child that has its datasource="src_child"
There is a defined action-based automation script CRTCHILD that is authorized for use w/in the application, and associated with a push button on the mainrecord.
The PROBLEMS I'm having are two-fold:
- How to most elegantly get a newly created child mbo via the script so that I can set values AND have it show up properly in the dialog box
- How to get the dialog box to properly display the newly created child mbo found in #1
This is the script I've been using--it WORKS (accomplishes both #1 and #2), but it is ugly. Curious if anyone has suggestions about how to improve!
from psdi.server import MXServer;
from psdi.mbo import MboConstants;
session = service.webclientsession();
databean = session.getDataBean("src_child");
set = databean.getMboSet();
databean.addrow();
set = databean.getMboSet();
ID = 0;
s = set.moveFirst();
while (s != None):
if (s.getLong("PLUSGSHFTLOGENTRYID") > ID):
ID = s.getLong("PLUSGSHFTLOGENTRYID");
s = set.moveNext();
child = databean.getMboForUniqueId(ID);
owner = child.getOwner();
child.setValue("FIELDS HERE", "VALUES HERE", FLAGS_HERE);
session.loadDialog("dialog_child");
service.error("GRE", "NONE", [""]);
#EverythingMaximo------------------------------
Jade Warren
Great River Energy
------------------------------