Hello all,
Can somebody please point out what I am doing wrong with the below code. Why am I getting the error "Error HRESULT E_FAIL has been returned from a call to a COM component." when I hit that line "POPOR1detail5.Update()" when trying to create a PO in Accpac 6.0
I've converted the vba code to C# and VB and it still throw the same error at the same line..
Thank you.
Can somebody please point out what I am doing wrong with the below code. Why am I getting the error "Error HRESULT E_FAIL has been returned from a call to a COM component." when I hit that line "POPOR1detail5.Update()" when trying to create a PO in Accpac 6.0
Code:
POPOR1header.Order = 1
POPOR1header.Order = 0
POPOR1headerFields.FieldByName("PORHSEQ").PutWithoutVerification("0") ' Purchase Order Sequence Key
POPOR1header.Init()
POPOR1header.Order = 1
temp = POPOR1detail1.Exists
POPOR1detail1.RecordClear()
POPOR1detail3.Init()
POPOR1detail2.Init()
POPOR1headerFields.FieldByName("VDCODE").Value = "200048" ' Vendor
POPOR1headerFields.FieldByName("PROCESSCMD").PutWithoutVerification("1") ' Command
POPOR1header.Process()
''
POPOR1detail5Fields.FieldByName("OPTFIELD").PutWithoutVerification("ORDERTAKEN") ' Optional Field
POPOR1detail5.Read()
POPOR1detail5Fields.FieldByName("SWSET").Value = "1" ' Value Set
temp = POPOR1detail5.Exists
POPOR1detail5Fields.FieldByName("VALIFTEXT").Value = "00" ' Text Value
POPOR1detail5.Update() '<-------THIS IS WHERE I GET THE ERROR
I've converted the vba code to C# and VB and it still throw the same error at the same line..
Thank you.