Hi Forum, I have a script to populate GL Accounts in PO Order Entry based on warehouse code UDF_Segment. I was able to make it work and all of a sudden stopped working. LastErrMsg is "Column not in IOList". I was able to test and i had no problems at all up until today. Actually it worked on a couple of entries and now it doesn't work at all. I am using: retVal = oBusObj.SetValue("AccountKey$", GLAccount) to populate the GL Account..... Here is the script: retVal = 0 TransactionType = "" oGlAccount = 0 oLines = 0 oProdLine = 0 oWhseCode = 0 TmpGL = "" TmpType = "" TmpNewGL = "" TmpInvAcct = "" TmpCOGSAcct = "" ProdLine = "" GLAccount = "" MainAcct = "" WhseCode = "" GLSegment = "" DfltWhse = "" item = "" sCompany = oSession.CompanyCode if sCompany = "TS2" then 'strMsg = "Company code: " & sCompany 'retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oBusObj.GetValue("ProductLine$", ProdLine) retVal = oBusObj.GetValue("WarehouseCode$", DfltWhse) Set oProdLine = oSession.AsObject(oSession.GetObject("IM_ProductLine_svc")) retVal = oProdLine.Find(ProdLine) strMsg = "ProdLine Find return code: " & retVal & " ProdLine Found: " & ProdLine & " DfltWhse: " & DfltWhse retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oProdLine.GetValue("InventoryAcctKey$",TmpInvAcct) strMsg = "ProdLine Acct return code: " & retVal & " Account Found: " & TmpInvAcct retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) Set oGLAccount = oSession.AsObject(oSession.GetObject("GL_Account_svc")) 'Set oGLAccount = oSession.AsObject(oBusObj.GetChildHandle("TmpInvAcct")) Acct = "" retVal = oGLAccount.Find(TmpInvAcct) 'Find GL Account retVal = oGLAccount.GetValue("MainAccountCode$", MainAcct) strMsg = "GL Account Return code: " & retVal & " Main Account Found: " & MainAcct retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) '******* Warehouse Code ********* retVal = oBusObj.GetValue("WarehouseCode$", WhseCode) Set oWhseCode = oSession.AsObject(oSession.GetObject("IM_Warehouse_svc")) retVal = oWhseCode.SetKeyValue("ItemCode$", item) retVal = oWhseCode.SetKeyValue("WarehouseCode$", WhseCode) '******* Find Warehouse to get GL Segment ********* retVal = oWhseCode.Find(WhseCode) strMsg = "WhseCode Find return code: " & retVal & " WhseCode Found: " & WhseCode retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oWhseCode.GetValue("UDF_GL_POSTING$", GLSegment) if GLSegment "" then GLAccount = MainAcct & GLSegment '******* Purchases Account ********* retVal = oBusObj.SetValue("AccountKey$", GLAccount) If retVal = 0 then rVal = oSession.AsObject(oSession.UI).MessageBox("", "FAILED! - " & oBusObj.LastErrorMsg) End if strMsg = "SetValue GL Account$ return code: " & retVal & " GL Account Found: " & GLAccount retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) end if end if Thanks in advance for any advise.. Manuel Roman
↧