Hi,
does any one know how to search batch(#) which open, and w/ certain batch description ?
I tried to search manual for accpac api but i have no luck sofar.
can someone tell me ".Browse, .init" what this sub do ?
here is my test code for searching batch no; I kept getting 0, even i have those batch.
mDBLinkCmpRW = mySession.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_COMPANY, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)
Dim APINVOICE1batch As AccpacCOMAPI.AccpacView
Dim APINVOICE1batchFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0020", APINVOICE1batch)
APINVOICE1batchFields = APINVOICE1batch.Fields
Dim APINVOICE1header As AccpacCOMAPI.AccpacView
Dim APINVOICE1headerFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0021", APINVOICE1header)
APINVOICE1headerFields = APINVOICE1header.Fields
Dim APINVOICE1detail1 As AccpacCOMAPI.AccpacView
Dim APINVOICE1detail1Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0022", APINVOICE1detail1)
APINVOICE1detail1Fields = APINVOICE1detail1.Fields
Dim APINVOICE1detail2 As AccpacCOMAPI.AccpacView
Dim APINVOICE1detail2Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0023", APINVOICE1detail2)
APINVOICE1detail2Fields = APINVOICE1detail2.Fields
APINVOICE1batch.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1header})
APINVOICE1header.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1batch, APINVOICE1detail1, APINVOICE1detail2})
APINVOICE1detail1.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1header, APINVOICE1batch})
APINVOICE1detail2.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1header})
APINVOICE1batch.Browse("((BTCHSTTS = 1) OR (BTCHSTTS = 7))",1)
APINVOICE1batchFields.FieldByName("BTCHDESC").PutWithoutVerification("CAD BATCH POSTED FROM INTRANET") ' Batch Number
APINVOICE1batch.Read()
APINVOICE1detail2.Init()
APINVOICE1headerFields.FieldByName("CNTITEM").PutWithoutVerification("0") ' Entry Number
Label1.Text = APINVOICE1batchFields.FieldByName("CNTBTCH").Value
Thanks
carlos yuwono
does any one know how to search batch(#) which open, and w/ certain batch description ?
I tried to search manual for accpac api but i have no luck sofar.
can someone tell me ".Browse, .init" what this sub do ?
here is my test code for searching batch no; I kept getting 0, even i have those batch.
mDBLinkCmpRW = mySession.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_COMPANY, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)
Dim APINVOICE1batch As AccpacCOMAPI.AccpacView
Dim APINVOICE1batchFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0020", APINVOICE1batch)
APINVOICE1batchFields = APINVOICE1batch.Fields
Dim APINVOICE1header As AccpacCOMAPI.AccpacView
Dim APINVOICE1headerFields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0021", APINVOICE1header)
APINVOICE1headerFields = APINVOICE1header.Fields
Dim APINVOICE1detail1 As AccpacCOMAPI.AccpacView
Dim APINVOICE1detail1Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0022", APINVOICE1detail1)
APINVOICE1detail1Fields = APINVOICE1detail1.Fields
Dim APINVOICE1detail2 As AccpacCOMAPI.AccpacView
Dim APINVOICE1detail2Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView("AP0023", APINVOICE1detail2)
APINVOICE1detail2Fields = APINVOICE1detail2.Fields
APINVOICE1batch.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1header})
APINVOICE1header.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1batch, APINVOICE1detail1, APINVOICE1detail2})
APINVOICE1detail1.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1header, APINVOICE1batch})
APINVOICE1detail2.Compose(New AccpacCOMAPI.AccpacView() {APINVOICE1header})
APINVOICE1batch.Browse("((BTCHSTTS = 1) OR (BTCHSTTS = 7))",1)
APINVOICE1batchFields.FieldByName("BTCHDESC").PutWithoutVerification("CAD BATCH POSTED FROM INTRANET") ' Batch Number
APINVOICE1batch.Read()
APINVOICE1detail2.Init()
APINVOICE1headerFields.FieldByName("CNTITEM").PutWithoutVerification("0") ' Entry Number
Label1.Text = APINVOICE1batchFields.FieldByName("CNTBTCH").Value
Thanks
carlos yuwono