0

Is it possible to add to a CustomMboSet in Maximo using scripting? I am writing a custom application using a custom object called TIMESHEET. As part of the application I am writing a (Jython) script that needs to dynamically build up an MboSet (a set of TIMESHEETs). The code retrieves an existing CustomMboSet and attempts to add elements to it. It works when using an out of box MboSet, but when I try to run the same code on a custom MboSet it does not seem to work. No error is thrown, but code below the offending line is not run.

In other words, this works (LABTRANS is an out of box MBO):

myMboSet = mbo.getMboSet("LABTRANS")
newMbo = myMboSet.add()
# Set attributes on newMbo, everything is happy

But this does not (TIMESHEET is a custom MBO):

myMboSet = mbo.getMboSet("TIMESHEET")
newMbo = myMboSet.add()
# Code does not execute after the above line

Anyone have any insight as to why I am seeing this behavior? Does the Maximo scripting framework simply not support the dynamic building up of CustomMboSets? Any help is appreciated. Thanks.

stevepoll
  • 51
  • 3
  • 6

3 Answers3

0

You need to make sure that the relationship exists between the Current MBO and the Custom MBO in the database configuration otherwise it will not work.

Alternatively you can use the following code to create an new mboSet on the fly:

timeSheetMboSet = mxServer.getMboSet("TIMESHEET", userInfo)
  • Thanks for the reply, Andrew, and sorry for the late response. I solved the issue. It turned out to be related to one of the attributes of the custom object. Since the custom object was created at the org level, orgid was a required attribute. It turned out that the orgid attribute had a Search Type of "None". Changing this to any other value (I chose Wildcard) allowed my script to work. Thanks again for the input! – stevepoll Dec 31 '14 at 17:11
0
mbo.getMboSet(RELATIONSHIPNAME).

LABTRANS and TIMESHEET must be the relationship names to the object in auto script.

If you want to get/add records in any object, use

mxServer.getMboSet(OBJECTNAME, userInfo)
ByteHamster
  • 4,884
  • 9
  • 38
  • 53
Sri
  • 1
0

A bit more explanation. You can create your own custom relationship from within your automation script. The trick is to make sure it's not already existing. That's why I use a dollar sign for mine.

variable = mbo.getMboSet(tempRelationshipName,Object,where clause)

previousPhaseSet = mbo.getMboSet("$wophasetranstemp1", "exitdate is null")
theShadraq
  • 29
  • 4