Dear all i am build windows application on click i want to create new order entry and shipall the error when i press the button its create order entry but with no shipment and invoice id here the code
Dim OEORD1header As AccpacCOMAPI.AccpacView
Dim OEORD1headerFields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail1 As AccpacCOMAPI.AccpacView
Dim OEORD1detail1Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail2 As AccpacCOMAPI.AccpacView
Dim OEORD1detail2Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail3 As AccpacCOMAPI.AccpacView
Dim OEORD1detail3Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail4 As AccpacCOMAPI.AccpacView
Dim OEORD1detail4Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail5 As AccpacCOMAPI.AccpacView
Dim OEORD1detail5Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail6 As AccpacCOMAPI.AccpacView
Dim OEORD1detail6Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail7 As AccpacCOMAPI.AccpacView
Dim OEORD1detail7Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail8 As AccpacCOMAPI.AccpacView
Dim OEORD1detail8Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail9 As AccpacCOMAPI.AccpacView
Dim OEORD1detail9Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail10 As AccpacCOMAPI.AccpacView
Dim OEORD1detail10Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail11 As AccpacCOMAPI.AccpacView
Dim OEORD1detail11Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail12 As AccpacCOMAPI.AccpacView
Dim OEORD1detail12Fields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTOMER2header As AccpacCOMAPI.AccpacView
Dim ARCUSTOMER2headerFields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTOMER2detail As AccpacCOMAPI.AccpacView
Dim ARCUSTOMER2detailFields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTSTAT3 As AccpacCOMAPI.AccpacView
Dim ARCUSTSTAT3Fields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTCMT4 As AccpacCOMAPI.AccpacView
Dim ARCUSTCMT4Fields As AccpacCOMAPI.AccpacViewFields
Public Sub Create_IC_Shipment_IU(ByVal InvoiceID As Integer, ByVal Type As Integer, ByVal Customer As Integer, ByVal TransactionDate As Date, ByVal LocationId As Integer, ByVal Desc As String, ByVal Refe As String, ByVal PostFlage As Integer)
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
mDBLinkCmpRW = Session.OpenDBLink(tagDBLinkTypeEnum.DBLINK_COMPANY, tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
mDBLinkSysRW = Session.OpenDBLink(tagDBLinkTypeEnum.DBLINK_SYSTEM, tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)
Dim temp As Boolean
mDBLinkCmpRW.OpenView("OE0520", OEORD1header)
OEORD1headerFields = OEORD1header.Fields
mDBLinkCmpRW.OpenView("OE0500", OEORD1detail1)
OEORD1detail1Fields = OEORD1detail1.Fields
mDBLinkCmpRW.OpenView("OE0740", OEORD1detail2)
OEORD1detail2Fields = OEORD1detail2.Fields
mDBLinkCmpRW.OpenView("OE0180", OEORD1detail3)
OEORD1detail3Fields = OEORD1detail3.Fields
mDBLinkCmpRW.OpenView("OE0526", OEORD1detail4)
OEORD1detail4Fields = OEORD1detail4.Fields
mDBLinkCmpRW.OpenView("OE0522", OEORD1detail5)
OEORD1detail5Fields = OEORD1detail5.Fields
mDBLinkCmpRW.OpenView("OE0508", OEORD1detail6)
OEORD1detail6Fields = OEORD1detail6.Fields
mDBLinkCmpRW.OpenView("OE0507", OEORD1detail7)
OEORD1detail7Fields = OEORD1detail7.Fields
mDBLinkCmpRW.OpenView("OE0501", OEORD1detail8)
OEORD1detail8Fields = OEORD1detail8.Fields
mDBLinkCmpRW.OpenView("OE0502", OEORD1detail9)
OEORD1detail9Fields = OEORD1detail9.Fields
mDBLinkCmpRW.OpenView("OE0504", OEORD1detail10)
OEORD1detail10Fields = OEORD1detail10.Fields
mDBLinkCmpRW.OpenView("OE0506", OEORD1detail11)
OEORD1detail11Fields = OEORD1detail11.Fields
mDBLinkCmpRW.OpenView("OE0503", OEORD1detail12)
OEORD1detail12Fields = OEORD1detail12.Fields
Dim OEORD1header_arr() As AccpacView = {OEORD1detail1, Nothing, OEORD1detail3, OEORD1detail2, OEORD1detail4, OEORD1detail5}
Dim OEORD1detail1_arr() As AccpacView = {OEORD1header, OEORD1detail8, OEORD1detail12, OEORD1detail9, OEORD1detail6, OEORD1detail7}
Dim OEORD1detail2_arr() As AccpacView = {OEORD1header}
Dim OEORD1detail3_arr() As AccpacView = {OEORD1header, OEORD1detail1}
Dim OEORD1detail4_arr() As AccpacView = {OEORD1header}
Dim OEORD1detail5_arr() As AccpacView = {OEORD1header}
Dim OEORD1detail6_arr() As AccpacView = {OEORD1detail1}
Dim OEORD1detail7_arr() As AccpacView = {OEORD1detail1}
Dim OEORD1detail8_arr() As AccpacView = {OEORD1detail1}
Dim OEORD1detail9_arr() As AccpacView = {OEORD1detail1, OEORD1detail10, OEORD1detail11}
Dim OEORD1detail10_arr() As AccpacView = {OEORD1detail9}
Dim OEORD1detail11_arr() As AccpacView = {OEORD1detail9}
Dim OEORD1detail12_arr() As AccpacView = {OEORD1detail1}
OEORD1header.Compose(OEORD1header_arr)
OEORD1detail1.Compose(OEORD1detail1_arr)
OEORD1detail2.Compose(OEORD1detail2_arr)
OEORD1detail3.Compose(OEORD1detail3_arr)
OEORD1detail4.Compose(OEORD1detail4_arr)
OEORD1detail5.Compose(OEORD1detail5_arr)
OEORD1detail6.Compose(OEORD1detail6_arr)
OEORD1detail7.Compose(OEORD1detail7_arr)
OEORD1detail8.Compose(OEORD1detail8_arr)
OEORD1detail9.Compose(OEORD1detail9_arr)
OEORD1detail10.Compose(OEORD1detail10_arr)
OEORD1detail11.Compose(OEORD1detail11_arr)
OEORD1detail12.Compose(OEORD1detail12_arr)
OEORD1headerFields.FieldByName("DRIVENBYUI").Value = "1" ' Driven by UI
OEORD1header.Cancel()
OEORD1header.Cancel()
OEORD1header.Init()
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields.FieldByName("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields.FieldByName("CUSTOMER").Value = "006826-02" ' Customer Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields.FieldByName("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields.FieldByName("PROCESSCMD").PutWithoutVerification("1") ' Process OIP Command
OEORD1header.Process()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordClear()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields.FieldByName("ITEM").Value = "01-S02-P01" ' Item
OEORD1detail1.Process()
OEORD1detail1Fields.FieldByName("QTYORDERED").Value = "1.0000" ' Quantity Ordered
OEORD1detail1.Insert()
OEORD1detail1Fields.FieldByName("LINENUM").PutWithoutVerification("-1") ' Line Number
OEORD1headerFields.FieldByName("GOSHIPALL").PutWithoutVerification("1") ' Perform Ship All
OEORD1header.Process()
OEORD1headerFields.FieldByName("INVPRODUCE").Value=1 ' Invoice Will Be Produced
OEORD1headerFields.FieldByName("OECOMMAND").Value = 4 ' Process O/E Command
'vwOrderFields("GOSHIPALL").PutWithoutVerification("1") ' Perform Ship All
'vwOrder.Process()
'vwOrderFields("INVPRODUCE").Value = "1" ' Invoice Will Be Produced
'vwDetails.Read()
'vwOrderFields("GOCALCTAX").PutWithoutVerification("1") ' Perform Tax Calculation
'vwOrder.Process()
'vwOrderFields("INVNUMBER").Value = objInvoice.InvoiceNo
OEORD1header.Process()
temp = OEORD1header.Exists
OEORD1header.insert()
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
End Sub
Dim OEORD1header As AccpacCOMAPI.AccpacView
Dim OEORD1headerFields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail1 As AccpacCOMAPI.AccpacView
Dim OEORD1detail1Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail2 As AccpacCOMAPI.AccpacView
Dim OEORD1detail2Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail3 As AccpacCOMAPI.AccpacView
Dim OEORD1detail3Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail4 As AccpacCOMAPI.AccpacView
Dim OEORD1detail4Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail5 As AccpacCOMAPI.AccpacView
Dim OEORD1detail5Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail6 As AccpacCOMAPI.AccpacView
Dim OEORD1detail6Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail7 As AccpacCOMAPI.AccpacView
Dim OEORD1detail7Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail8 As AccpacCOMAPI.AccpacView
Dim OEORD1detail8Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail9 As AccpacCOMAPI.AccpacView
Dim OEORD1detail9Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail10 As AccpacCOMAPI.AccpacView
Dim OEORD1detail10Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail11 As AccpacCOMAPI.AccpacView
Dim OEORD1detail11Fields As AccpacCOMAPI.AccpacViewFields
Dim OEORD1detail12 As AccpacCOMAPI.AccpacView
Dim OEORD1detail12Fields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTOMER2header As AccpacCOMAPI.AccpacView
Dim ARCUSTOMER2headerFields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTOMER2detail As AccpacCOMAPI.AccpacView
Dim ARCUSTOMER2detailFields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTSTAT3 As AccpacCOMAPI.AccpacView
Dim ARCUSTSTAT3Fields As AccpacCOMAPI.AccpacViewFields
Dim ARCUSTCMT4 As AccpacCOMAPI.AccpacView
Dim ARCUSTCMT4Fields As AccpacCOMAPI.AccpacViewFields
Public Sub Create_IC_Shipment_IU(ByVal InvoiceID As Integer, ByVal Type As Integer, ByVal Customer As Integer, ByVal TransactionDate As Date, ByVal LocationId As Integer, ByVal Desc As String, ByVal Refe As String, ByVal PostFlage As Integer)
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
mDBLinkCmpRW = Session.OpenDBLink(tagDBLinkTypeEnum.DBLINK_COMPANY, tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
mDBLinkSysRW = Session.OpenDBLink(tagDBLinkTypeEnum.DBLINK_SYSTEM, tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE)
Dim temp As Boolean
mDBLinkCmpRW.OpenView("OE0520", OEORD1header)
OEORD1headerFields = OEORD1header.Fields
mDBLinkCmpRW.OpenView("OE0500", OEORD1detail1)
OEORD1detail1Fields = OEORD1detail1.Fields
mDBLinkCmpRW.OpenView("OE0740", OEORD1detail2)
OEORD1detail2Fields = OEORD1detail2.Fields
mDBLinkCmpRW.OpenView("OE0180", OEORD1detail3)
OEORD1detail3Fields = OEORD1detail3.Fields
mDBLinkCmpRW.OpenView("OE0526", OEORD1detail4)
OEORD1detail4Fields = OEORD1detail4.Fields
mDBLinkCmpRW.OpenView("OE0522", OEORD1detail5)
OEORD1detail5Fields = OEORD1detail5.Fields
mDBLinkCmpRW.OpenView("OE0508", OEORD1detail6)
OEORD1detail6Fields = OEORD1detail6.Fields
mDBLinkCmpRW.OpenView("OE0507", OEORD1detail7)
OEORD1detail7Fields = OEORD1detail7.Fields
mDBLinkCmpRW.OpenView("OE0501", OEORD1detail8)
OEORD1detail8Fields = OEORD1detail8.Fields
mDBLinkCmpRW.OpenView("OE0502", OEORD1detail9)
OEORD1detail9Fields = OEORD1detail9.Fields
mDBLinkCmpRW.OpenView("OE0504", OEORD1detail10)
OEORD1detail10Fields = OEORD1detail10.Fields
mDBLinkCmpRW.OpenView("OE0506", OEORD1detail11)
OEORD1detail11Fields = OEORD1detail11.Fields
mDBLinkCmpRW.OpenView("OE0503", OEORD1detail12)
OEORD1detail12Fields = OEORD1detail12.Fields
Dim OEORD1header_arr() As AccpacView = {OEORD1detail1, Nothing, OEORD1detail3, OEORD1detail2, OEORD1detail4, OEORD1detail5}
Dim OEORD1detail1_arr() As AccpacView = {OEORD1header, OEORD1detail8, OEORD1detail12, OEORD1detail9, OEORD1detail6, OEORD1detail7}
Dim OEORD1detail2_arr() As AccpacView = {OEORD1header}
Dim OEORD1detail3_arr() As AccpacView = {OEORD1header, OEORD1detail1}
Dim OEORD1detail4_arr() As AccpacView = {OEORD1header}
Dim OEORD1detail5_arr() As AccpacView = {OEORD1header}
Dim OEORD1detail6_arr() As AccpacView = {OEORD1detail1}
Dim OEORD1detail7_arr() As AccpacView = {OEORD1detail1}
Dim OEORD1detail8_arr() As AccpacView = {OEORD1detail1}
Dim OEORD1detail9_arr() As AccpacView = {OEORD1detail1, OEORD1detail10, OEORD1detail11}
Dim OEORD1detail10_arr() As AccpacView = {OEORD1detail9}
Dim OEORD1detail11_arr() As AccpacView = {OEORD1detail9}
Dim OEORD1detail12_arr() As AccpacView = {OEORD1detail1}
OEORD1header.Compose(OEORD1header_arr)
OEORD1detail1.Compose(OEORD1detail1_arr)
OEORD1detail2.Compose(OEORD1detail2_arr)
OEORD1detail3.Compose(OEORD1detail3_arr)
OEORD1detail4.Compose(OEORD1detail4_arr)
OEORD1detail5.Compose(OEORD1detail5_arr)
OEORD1detail6.Compose(OEORD1detail6_arr)
OEORD1detail7.Compose(OEORD1detail7_arr)
OEORD1detail8.Compose(OEORD1detail8_arr)
OEORD1detail9.Compose(OEORD1detail9_arr)
OEORD1detail10.Compose(OEORD1detail10_arr)
OEORD1detail11.Compose(OEORD1detail11_arr)
OEORD1detail12.Compose(OEORD1detail12_arr)
OEORD1headerFields.FieldByName("DRIVENBYUI").Value = "1" ' Driven by UI
OEORD1header.Cancel()
OEORD1header.Cancel()
OEORD1header.Init()
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields.FieldByName("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields.FieldByName("CUSTOMER").Value = "006826-02" ' Customer Number
OEORD1detail2.Browse("", 1)
OEORD1detail2Fields.FieldByName("PAYMENT").PutWithoutVerification("-32767") ' Payment Number
OEORD1detail2.Browse("", -1)
OEORD1detail2.Fetch()
OEORD1headerFields.FieldByName("PROCESSCMD").PutWithoutVerification("1") ' Process OIP Command
OEORD1header.Process()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordClear()
temp = OEORD1detail1.Exists
OEORD1detail1.RecordCreate(0)
OEORD1detail1Fields.FieldByName("ITEM").Value = "01-S02-P01" ' Item
OEORD1detail1.Process()
OEORD1detail1Fields.FieldByName("QTYORDERED").Value = "1.0000" ' Quantity Ordered
OEORD1detail1.Insert()
OEORD1detail1Fields.FieldByName("LINENUM").PutWithoutVerification("-1") ' Line Number
OEORD1headerFields.FieldByName("GOSHIPALL").PutWithoutVerification("1") ' Perform Ship All
OEORD1header.Process()
OEORD1headerFields.FieldByName("INVPRODUCE").Value=1 ' Invoice Will Be Produced
OEORD1headerFields.FieldByName("OECOMMAND").Value = 4 ' Process O/E Command
'vwOrderFields("GOSHIPALL").PutWithoutVerification("1") ' Perform Ship All
'vwOrder.Process()
'vwOrderFields("INVPRODUCE").Value = "1" ' Invoice Will Be Produced
'vwDetails.Read()
'vwOrderFields("GOCALCTAX").PutWithoutVerification("1") ' Perform Tax Calculation
'vwOrder.Process()
'vwOrderFields("INVNUMBER").Value = objInvoice.InvoiceNo
OEORD1header.Process()
temp = OEORD1header.Exists
OEORD1header.insert()
OEORD1header.Order = 1
OEORD1header.Read()
OEORD1header.Order = 0
End Sub