使用自动化脚本基于映射到它的PO获取合同行值

时间:2016-08-31 14:40:07

标签: jython maximo

我需要根据已映射到它的PO来获取CONTRACTLINE详细信息。所以我在PO上创建了一个Object启动点,它将在“UPDATE”期间触发,但是CONTRACTLINE上的getMbo(0)是BLANK,我不知道是什么问题因为计数是> 0所以理想情况下它应该获取值。

userInfo=mbo.getUserInfo()
POContractNum = mbo.getString("CONTRACTREFNUM")
POContractRevNum = mbo.getInt("CONTRACTREFREV")
POContractOrgID = mbo.getString("ORGID")
PONum = mbo.getString("PONUM")
ContractSet = MXServer.getMXServer().getMboSet("CONTRACT",userInfo)
ContractSet.setWhere("CONTRACTNUM = '" + POContractNum + "' and STATUS=  'APPR'  and ORGID = '" + POContractOrgID + "'")
ContractSet.reset()
Contract = ContractSet.getMbo(0)
print 'Contract number', ContractSet.getMbo(0).getString("CONTRACTNUM")
ContractLineSet = MXServer.getMXServer().getMboSet("CONTRACTLINE",userInfo)
ContractLineSet.setWhere("CONTRACTNUM = '" + POContractNum + "' and  LINESTATUS = 'APPR'  and ORGID = '" + POContractOrgID + "'")
ContractLineSet.reset()
print " Contract Line Where : " + ContractLineSet.getWhere()
print " Contract Lines Selected = " + str(ContractLineSet.count())
print " mbo contract line contract num ",   ContractLineSet.getMbo(0).getString("CONTRACTNUM")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Contract number PCR1214
Contract Line Where : CONTRACTNUM = 'PCR1214' and LINESTATUS = 'APPR'  and ORGID = 'XXXX'
Contract Lines Selected = 1
mbo contract line contract num 

1 个答案:

答案 0 :(得分:0)

我想我之前遇到过一个非常类似的问题。请在这里查看答案: https://stackoverflow.com/a/27423780/1341373