I have a requirement to fetch CONTRACTLINE details based on the PO to which it has been mapped to it . So I have created an Object launch point on PO which will be triggered during "UPDATE" however the getMbo(0) on CONTRACTLINE is BLANK , I am not sure what is the issue as the count is >0 so ideally it should fetch the values.
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