Skip to main contentCarbon Design System

REST Script Attribute (oslc.select)

In the oslc.select of the REST API request, you are able to define what to return in your request. There are many out of the box capabilities that should be utilized when possible. However, there may be a requirement to return something that is not possible with an out of the box method. To support that, we allow you to define script.scriptname in the oslc.select with scriptname being replaced with the automation script name.

Implicit variables

Variable nameDescription
mboThis is the MBO for the object that you are processing against. This could be the main object or child object depending on where the script.scriptname is referenced.
evalresultThis defines what to return as either a string or list. This must be set in your script and should not be null.
  1. In the Automation Script application, create a Script with no launch point. In our example below, the script name should be VENDORCATALOG.

Example script

from psdi.mbo import SqlFormat
catalogCodes=[]
sqf=SqlFormat(mbo,"itemnum = :itemnum and orgid = :orgid and (siteid is null or siteid = :siteid)")
invVendorSet=mbo.getThisMboSet().getSharedMboSet("INVVENDOR",sqf.format())
invVendorMbo=invVendorSet.moveFirst()
while invVendorMbo:
if invVendorMbo.getString("CATALOGCODE"):
catalogCodes.append(invVendorMbo.getString("CATALOGCODE"))

Call with a GET request like:

https://myurl.com/maximo/api/os/mxapicntbookline?lean=1&oslc.pageSize=1&oslc.select=countbooknum,siteid,script.vendorcatalog