Because you are calling getMboSet() on an instance of psdi.mbo.Mbo (find the JavaDocs here), the string you are passing is expected to be a relationship name -- most likely one you could find on the Relationships tab in Database Configuration for the Object on your Launch Point.
Given the above, the easiest way to do what you are asking is to use the functionality Maximo provides instead of doing it all yourself. Go to Database Configuration, find the Object used by your script's Launch Point, go to the Relationships tab and add a new Relationship. I assume the Child Object you want is VACTIMESHEET, and you can name the relationship after the Child Object or something more meaningful than the generic table name. For the Where Clause, specify the following.
ts_date = :vacation_start
and zzemployeeno = :zzemployeeno
Note the column names with a colon on the front. You will find those names on the Attributes tab right there in Database Configuration. Maximo will change those to the values from the record.
Now, you can go back to your script and use the relationship name you provided above in you call to mbo.getMboSet(), and Maximo will use the where clause you provided in Database Configuration for that Relationship.
------------------------------
Blessings,
Jason Uppenborn
Sr. Technical Maximo Consultant
Cohesive
------------------------------
Original Message:
Sent: Wed May 24, 2023 05:44 AM
From: mohammad moula
Subject: Using variables in setWhere within automation script
Hello,
mTS = mbo.getMboSet("VACTIMESHEET")
mVacstart = mbo.getDate("VACATION_START")
mEmpno = mbo.getString("ZZEMPLOYEENO")
I need to have setWere statement to search for a record in mTS object using the following conditions:
- TS_DATE = mVacstart
- ZZEMPLOYEENO = mEmpno
any help will be much appriciated
------------------------------
mohammad moula
------------------------------