I really need help. I created an Accpac integration in C# using the Accpac 5.4 Interop.AccpacCOMAPI.dll. The system worked great until I moved it over to Accpac 5.5. Unfortunately, my company's live Accpac system just got upgraded to 5.5 a few weeks back, so I don't have the option of sticking with 5.4.
The upgrade didn't break the entire integration, I am able to use the 5.4 API to create customer records in Accpac but the invoices fail on the header insert.
Since I was originally using the 5.4 Interop.AccpacCOMAPI.dll, I thought I might be able to just switch over to the 5.5 Interop.AccpacCOMAPI.dll, but that made matters worse. The 5.5 dll is missing the RecordCreate function on the AccpacView object. If I generate a macro for invoice creation in Accpac, the RecordCreate function is still used, so I don't see why it's not in the API.
If anything I mentioned reveals something I'm doing wrong please let me know. Below I will be inserting the code I am using when trying to create an invoice. I have created a wrapper to the API so some of my functions are not standard, but they call the standard functions. I have simplified my code in an attempt to remove any unnecessary code that would be breaking the system.
DateTime startDate = actStartDate;
EzAccpacModule invBatch = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0031");
EzAccpacModule invHeader = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0032");
EzAccpacModule invDetail1 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0033");
EzAccpacModule invDetail2 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0034");
EzAccpacModule invDetail3 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0402");
EzAccpacModule invDetail4 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0401");
Object obj = new Object();
invBatch.Compose(ref obj, (Object)(new AccpacView[1] { invHeader.module }));
invHeader.Compose(ref obj, (Object)(new AccpacView[5] { invBatch.module, invDetail1.module, invDetail2.module, invDetail3.module, null }));
invDetail1.Compose(ref obj, (Object)(new AccpacView[3] { invHeader.module, invBatch.module, invDetail4.module }));
invDetail2.Compose(ref obj, (Object)(new AccpacView[1] { invHeader.module }));
invDetail3.Compose(ref obj, (Object)(new AccpacView[1] { invHeader.module }));
invDetail4.Compose(ref obj, (Object)(new AccpacView[1] { invDetail1.module }));
invBatch.Browse("((BTCHSTTS = 1) OR (BTCHSTTS = 7))", true);
invBatch.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_INSERT);
invBatch.setNoValiFieldValue("PROCESSCMD", "1");
invBatch.Process();
invBatch.Read();
invHeader.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_NOINSERT);
invDetail1.Cancel();
invBatch.setNoValiFieldValue("BTCHDESC", actName + " 1st Invoice");
invBatch.Update();
invHeader.setFieldValue("IDCUST", actId);
invDetail1.RecordClear();
invDetail1.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_DELAYKEY);
invDetail1.setFieldValue("IDDIST", "L");
invDetail1.Insert();
The upgrade didn't break the entire integration, I am able to use the 5.4 API to create customer records in Accpac but the invoices fail on the header insert.
Since I was originally using the 5.4 Interop.AccpacCOMAPI.dll, I thought I might be able to just switch over to the 5.5 Interop.AccpacCOMAPI.dll, but that made matters worse. The 5.5 dll is missing the RecordCreate function on the AccpacView object. If I generate a macro for invoice creation in Accpac, the RecordCreate function is still used, so I don't see why it's not in the API.
If anything I mentioned reveals something I'm doing wrong please let me know. Below I will be inserting the code I am using when trying to create an invoice. I have created a wrapper to the API so some of my functions are not standard, but they call the standard functions. I have simplified my code in an attempt to remove any unnecessary code that would be breaking the system.
DateTime startDate = actStartDate;
EzAccpacModule invBatch = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0031");
EzAccpacModule invHeader = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0032");
EzAccpacModule invDetail1 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0033");
EzAccpacModule invDetail2 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0034");
EzAccpacModule invDetail3 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0402");
EzAccpacModule invDetail4 = new EzAccpacModule(ref ezAcSession.acDBLink, "AR0401");
Object obj = new Object();
invBatch.Compose(ref obj, (Object)(new AccpacView[1] { invHeader.module }));
invHeader.Compose(ref obj, (Object)(new AccpacView[5] { invBatch.module, invDetail1.module, invDetail2.module, invDetail3.module, null }));
invDetail1.Compose(ref obj, (Object)(new AccpacView[3] { invHeader.module, invBatch.module, invDetail4.module }));
invDetail2.Compose(ref obj, (Object)(new AccpacView[1] { invHeader.module }));
invDetail3.Compose(ref obj, (Object)(new AccpacView[1] { invHeader.module }));
invDetail4.Compose(ref obj, (Object)(new AccpacView[1] { invDetail1.module }));
invBatch.Browse("((BTCHSTTS = 1) OR (BTCHSTTS = 7))", true);
invBatch.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_INSERT);
invBatch.setNoValiFieldValue("PROCESSCMD", "1");
invBatch.Process();
invBatch.Read();
invHeader.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_NOINSERT);
invDetail1.Cancel();
invBatch.setNoValiFieldValue("BTCHDESC", actName + " 1st Invoice");
invBatch.Update();
invHeader.setFieldValue("IDCUST", actId);
invDetail1.RecordClear();
invDetail1.RecordCreate(tagViewRecordCreateEnum.VIEW_RECORD_CREATE_DELAYKEY);
invDetail1.setFieldValue("IDDIST", "L");
invDetail1.Insert();