You need to use SQLFORMAT class.
mTS = mbo.getMboSet("VACTIMESHEET")
sqlf = SqlFormat("ZZEMPLOYEENO = :1 and TS_DAY = :2")
sqlf.setObject(1,"ASSETMETER", "ZZEMPLOYEENO", mEpno)
sqlf.setObject(2,"ASSETMETER", "TS_DAY", mEpno)
mTS.setWhere(sqlf.format())
------------------------------
Prashant Sharma
Sedin Technologies
Connect with me @
https://www.linkedin.com/in/psharmamaximo/#IBM Champion 2022
#IBM Champion 2023
------------------------------
Original Message:
Sent: 05-23-2023 06:32
From: Mohammad Moula
Subject: setWere looking for a date and string attributes in automation script
Hello,
I have an automation script based on Object lanuch point "ZZAMSVACTRANS" object. While "ZZAMSVACTRANS" has a relationship with "ZZAMSTIMECARD" object through a named relation "VACSHEET". Now I want to get two attributes from current object "ZZAMSVACTRANS" which are a string attribute ( "ZZEMPLOYEENO") & a date attribute ("VACATION_START") . Next I want to search for those two fields in "VACTIMESHEET" as follow:
from psdi.server import MXServer
from psdi.mbo import SqlFormat
from psdi.mbo import MboValue
mVac = mbo.getTisMboSet()
mTS = mbo.getMboSet("VACTIMESHEET")
mEmpno = mVac.getString("ZZEMPLOYEENO")
mVacstart = mVac.getDate("VACATION_START")
** Next setWhere works fine but to search for only the string attribute
mTS.setWhere("ZZEMPLOYEENO="+mEpno)
** Next setWhere does not work ???
mTS.setWhere("TS_DAY="+mVacstart)
I got thise error as in the picture
#Administration
#Customizations
#EverythingMaximo
#Integrations
------------------------------
Mohammad Moula
eSolution
------------------------------