Hi -
I am putting finishing touches on an app that inserts an OE using the COMAPI. All works, except that there are issues with inventory - ACCPAC is not kept current, and an order can reject for insufficient on-hand inventory.
I want to trap that in advance of connecting to ACCPAC, and so tracked down the Location Quantities view, ICILOCI. My plan was to pre-validate the on-hand in ACCPAC prior to building the new OE; I currently validate itemno, custid and ordnumber (in case they try to process the same one twice). I doesn these by means of a simple ADO query - no Views. Now, to validate on-hand quantity by location, I must use the view.
I am looking for advice - and maybe a snippet or two of code. Thanks in advance...
This is what I have:
' *******************************************
Global accSessionMgr As New AccpacSessionMgr
Global accSession As AccpacSession
Global mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Global mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Global ICLOCIheader As AccpacCOMAPI.AccpacView
Global ICLOCIheaderFields As AccpacCOMAPI.AccpacViewFields
accSessionMgr.AppID = "AS"
accSessionMgr.AppVersion = "53A"
accSessionMgr.ProgramName = "AS1000"
accSessionMgr.ServerName = ""
accSessionMgr.CreateSession "", 0, accSession
If accSession.CompanyID <> "SNOBAL" Then
MsgBox "wrong database"
End
End If
accSession.GetSignonInfo accSession.UserID, accSession.CompanyID, accSession.CompanyName
Set mDBLinkCmpRW = accSession.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Set mDBLinkSysRW = accSession.OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
mDBLinkCmpRW.OpenView "IC0372", ICLOCIheader
Set ICLOCIheaderFields = ICLOCIheader.Fields
ICLOCQTheader.Init
ICLOCQTheader.Order = 0
ICLOCQTheader.Browse "", True
Do While ICLOCQTheader.Fetch = False
Debug.Print ICLOCQTheaderFields("STOCKUNIT").Name
Loop
' *********************************************
I am putting finishing touches on an app that inserts an OE using the COMAPI. All works, except that there are issues with inventory - ACCPAC is not kept current, and an order can reject for insufficient on-hand inventory.
I want to trap that in advance of connecting to ACCPAC, and so tracked down the Location Quantities view, ICILOCI. My plan was to pre-validate the on-hand in ACCPAC prior to building the new OE; I currently validate itemno, custid and ordnumber (in case they try to process the same one twice). I doesn these by means of a simple ADO query - no Views. Now, to validate on-hand quantity by location, I must use the view.
I am looking for advice - and maybe a snippet or two of code. Thanks in advance...
This is what I have:
' *******************************************
Global accSessionMgr As New AccpacSessionMgr
Global accSession As AccpacSession
Global mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Global mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Global ICLOCIheader As AccpacCOMAPI.AccpacView
Global ICLOCIheaderFields As AccpacCOMAPI.AccpacViewFields
accSessionMgr.AppID = "AS"
accSessionMgr.AppVersion = "53A"
accSessionMgr.ProgramName = "AS1000"
accSessionMgr.ServerName = ""
accSessionMgr.CreateSession "", 0, accSession
If accSession.CompanyID <> "SNOBAL" Then
MsgBox "wrong database"
End
End If
accSession.GetSignonInfo accSession.UserID, accSession.CompanyID, accSession.CompanyName
Set mDBLinkCmpRW = accSession.OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Set mDBLinkSysRW = accSession.OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
mDBLinkCmpRW.OpenView "IC0372", ICLOCIheader
Set ICLOCIheaderFields = ICLOCIheader.Fields
ICLOCQTheader.Init
ICLOCQTheader.Order = 0
ICLOCQTheader.Browse "", True
Do While ICLOCQTheader.Fetch = False
Debug.Print ICLOCQTheaderFields("STOCKUNIT").Name
Loop
' *********************************************