title: Maximo scripting cannot load second MboSet
body: <p>I've a script with an object launchpoint on INVOICELINE.
  For the mbo I want to get all INVOICELINES with the same PONUM as the current MBO (since they could be in other then the current mbo's invoice)</p>
  
  <p>In the script I find the PO like so: (to test for status)</p>
  
  <pre><code>from psdi.server import MXServer
  from psdi.mbo import Mbo
  from psdi.mbo import MboConstants
  from psdi.security import UserInfo
  from psdi.server import MXServer
  
  myMXServer = MXServer.getMXServer()
  userInfo = mbo.getThisMboSet().getUserInfo()
  
  # find the PO
  poSet = myMXServer.getMboSet("PO", userInfo)
  poSetWhere = "ponum='" + mbo.getString("PONUM") + "' and siteid='" + mbo.getString("POSITEID") + "' and status not in " + poNoUpdate
  poSet.setWhere(poSetWhere)
  
  poMbo = poSet.getMbo(0)
  </code></pre>
  
  <p>which works great.</p>
  
  <p>then later I do the very same for the set of invoicelines:</p>
  
  <pre><code>ilSet = myMXServer.getMboSet("INVOICELINE", userInfo)
  ilSetWhere = "ponum='" + mbo.getString("PONUM") + "' and positeid='" + mbo.getString("POSITEID") + "'"
  ilSet.setWhere(ilSetWhere)
  ilMbo = ilSet.moveFirst()
  
  while ilMbo is not None:
      ...
  </code></pre>
  
  <p>which results in a error on the setWhere line. Curiously, logging (which I removed for readability) indicates that ilSet contains all invoicelines records after the getMboSet (as expected), the ilSetWhere has a valid query that you can copy-paste in SQL Developer.</p>
  
  <p>Does Maximo need some index or so before it can execute this setWhere?</p>
  
  <p>Here is the logging result for the two setWhere strings:</p>
  
  <pre><code>ponum='4140006682' and siteid='mysite' and status not in ('CLOSED','CAN','GESLTN','ANN')
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ponum='4140006682' and positeid='mysite'
  </code></pre>
  
  <p>The error I get is a generic BMXAA7837E java.lang.NullPointerException in script at line... (the line refers to the line with the ilSet.setWhere(ilSetWhere) expression. I'm out of ideas how to fix this and have no clue how to work around it.</p>