This question is not answered

Dear All

How can i solve this problem :/  when trying to open view in accpac

All Replies
  • can you help me  

  • Nobody face this error ???????????????

  • Fancosh

    You say this is an Accpac error but the screen is from Sage CRM.  I personally have not seen the error message you have included.  Is this an error from a standard feature of the Sage CRM & Sage 300 ERP integration or has this error happened in a customization?  If this is an error in customization perhaps you would share the code you have used.

  • i put button on click its call the    RunAccpacPost method  its call it correctlly then i face the above error message.

    when the message appear i refresh the page then its do the code below correctly.

    the code add record in accpac order entry.

    public static void RunAccpacPost(ref Web AretVal)


               AretVal = new Accpac();


    namespace Lease.DataPages


       public class Accpac : Web


           private DBLink mDBLinkCmpRW;

           private DBLink mDBLinkSysRW;

           public override void BuildContents()





                           mDBLinkCmpRW = session.OpenDBLink(DBLinkType.Company, DBLinkFlags.ReadWrite);

                           mDBLinkSysRW = session.OpenDBLink(DBLinkType.Company, DBLinkFlags.ReadWrite);

                           Boolean temp;

                           ACCPAC.Advantage.View OEORD1header;

                           ACCPAC.Advantage.ViewFields OEORD1headerFields;

                           OEORD1header = mDBLinkCmpRW.OpenView("OE0520");

                           OEORD1headerFields =OEORD1header.Fields;

                           ACCPAC.Advantage.View OEORD1detail1;

                           ACCPAC.Advantage.ViewFields OEORD1detail1Fields;

                           OEORD1detail1 = mDBLinkCmpRW.OpenView("OE0500");

                           OEORD1detail1Fields = OEORD1detail1.Fields;

                           ACCPAC.Advantage.View OEORD1detail2;

                           ACCPAC.Advantage.ViewFields OEORD1detail2Fields;

                           OEORD1detail2 = mDBLinkCmpRW.OpenView("OE0740");

                           OEORD1detail2Fields = OEORD1detail2.Fields;

                           ACCPAC.Advantage.View OEORD1detail3;

                           ACCPAC.Advantage.ViewFields OEORD1detail3Fields;

                           OEORD1detail3 = mDBLinkCmpRW.OpenView("OE0180");

                           OEORD1detail3Fields = OEORD1detail3.Fields;

                           ACCPAC.Advantage.View OEORD1detail4;

                           ACCPAC.Advantage.ViewFields OEORD1detail4Fields;

                           OEORD1detail4 = mDBLinkCmpRW.OpenView("OE0526");

                           OEORD1detail4Fields = OEORD1detail4.Fields;

                           ACCPAC.Advantage.View OEORD1detail5;

                           ACCPAC.Advantage.ViewFields OEORD1detail5Fields;

                           OEORD1detail5 = mDBLinkCmpRW.OpenView("OE0522");

                           OEORD1detail5Fields = OEORD1detail5.Fields;

                           ACCPAC.Advantage.View OEORD1detail6;

                           ACCPAC.Advantage.ViewFields OEORD1detail6Fields;

                           OEORD1detail6 = mDBLinkCmpRW.OpenView("OE0508");

                           OEORD1detail6Fields = OEORD1detail6.Fields;

                           ACCPAC.Advantage.View OEORD1detail7;

                           ACCPAC.Advantage.ViewFields OEORD1detail7Fields;

                           OEORD1detail7 = mDBLinkCmpRW.OpenView("OE0507");

                           OEORD1detail7Fields = OEORD1detail7.Fields;

                           ACCPAC.Advantage.View OEORD1detail8;

                           ACCPAC.Advantage.ViewFields OEORD1detail8Fields;

                           OEORD1detail8 = mDBLinkCmpRW.OpenView("OE0501");

                           OEORD1detail8Fields = OEORD1detail8.Fields;

                           ACCPAC.Advantage.View OEORD1detail9;

                           ACCPAC.Advantage.ViewFields OEORD1detail9Fields;

                           OEORD1detail9 = mDBLinkCmpRW.OpenView("OE0502");

                           OEORD1detail9Fields = OEORD1detail9.Fields;

                           ACCPAC.Advantage.View OEORD1detail10;

                           ACCPAC.Advantage.ViewFields OEORD1detail10Fields;

                           OEORD1detail10 = mDBLinkCmpRW.OpenView("OE0504");

                           OEORD1detail10Fields = OEORD1detail10.Fields;

                           ACCPAC.Advantage.View OEORD1detail11;

                           ACCPAC.Advantage.ViewFields OEORD1detail11Fields;

                           OEORD1detail11 = mDBLinkCmpRW.OpenView("OE0506");

                           OEORD1detail11Fields = OEORD1detail11.Fields;

                           ACCPAC.Advantage.View OEORD1detail12;

                           ACCPAC.Advantage.ViewFields OEORD1detail12Fields;

                           OEORD1detail12 = mDBLinkCmpRW.OpenView("OE0503");

                           OEORD1detail12Fields = OEORD1detail12.Fields;

                           OEORD1header.Compose(new ACCPAC.Advantage.View[] { OEORD1detail1, null, OEORD1detail3, OEORD1detail2, OEORD1detail4, OEORD1detail5 });

                           OEORD1detail1.Compose(new ACCPAC.Advantage.View[] { OEORD1header, OEORD1detail8, OEORD1detail12, OEORD1detail9, OEORD1detail6, OEORD1detail7 });

                           OEORD1detail2.Compose(new ACCPAC.Advantage.View[] { OEORD1header });

                           OEORD1detail3.Compose(new ACCPAC.Advantage.View[] { OEORD1header, OEORD1detail1 });

                           OEORD1detail4.Compose(new ACCPAC.Advantage.View[] { OEORD1header });

                           OEORD1detail5.Compose(new ACCPAC.Advantage.View[] { OEORD1header });

                           OEORD1detail6.Compose(new ACCPAC.Advantage.View[] { OEORD1detail1 });

                           OEORD1detail7.Compose(new ACCPAC.Advantage.View[] { OEORD1detail1 });

                           OEORD1detail8.Compose(new ACCPAC.Advantage.View[] { OEORD1detail1 });

                           OEORD1detail9.Compose(new ACCPAC.Advantage.View[] { OEORD1detail1, OEORD1detail10, OEORD1detail11 });

                           OEORD1detail10.Compose(new ACCPAC.Advantage.View[] { OEORD1detail9 });

                           OEORD1detail11.Compose(new ACCPAC.Advantage.View[] { OEORD1detail9 });

                           OEORD1detail12.Compose(new ACCPAC.Advantage.View[] { OEORD1detail1 });

                           OEORD1header.Fields.FieldByName("DRIVENBYUI").SetValue ("1",false);//                        ' Driven by UI




                       OEORD1detail2.Fields.FieldByName("PAYMENT").SetValue("-32767", false);//     ' Payment Number


                       OEORD1header.Fields.FieldByName("CUSTOMER").SetValue("1105", true);//                     ' Customer Number

                        OEORD1detail2.Fields.FieldByName("PAYMENT").SetValue("-32767",true); //     ' Payment Number

                        OEORD1header.Fields.FieldByName("SHIPTO").SetValue("EAST", true);             //   ' Ship-To Location Code

                        OEORD1header.Fields.FieldByName("GOFCALCTAX").SetValue("1", true);     //    ' Perform Forced Tax Calculation



                        OEORD1header.Fields.FieldByName("PROCESSCMD").SetValue("1",true) ;//        ' Process OIP Command


                        temp = OEORD1detail1.Exists;


                        temp = OEORD1detail1.Exists;


                        OEORD1detail1.Fields.FieldByName("ITEM").SetValue("A1-105/0", true);                     //   ' Item



                        OEORD1detail1.Fields.FieldByName("LINENUM").SetValue("-1", true);        //  ' Line Number


                        OEORD1header.Fields.FieldByName("OECOMMAND").SetValue("4", true);                   //    ' Process O/E Command

                        OEORD1header.Fields.FieldByName("DESC").SetValue(GetContextInfo("Lease", "leas_contractid"), true);      //    ' Order Description



                        OEORD1header.Order = 1;


                        OEORD1header.Order = 0;

                        OEORD1detail1.Fields.FieldByName("LINENUM").SetValue("-32767", true); //    ' Line Number


                        OEORD1detail9.Fields.FieldByName("PRNCOMPNUM").SetValue("-2147483647", true); //  ' Parent Component Number

                        OEORD1detail9.Fields.FieldByName("COMPNUM").SetValue("-2147483647", true); // ' Component Number


                        OEORD1detail3.Fields.FieldByName("UNIQUIFIER").SetValue("-32767", true); // ' Uniquifier


                        OEORD1detail2.Fields.FieldByName("PAYMENT").SetValue("-32767", true);   //   ' Payment Number


                        OEORD1detail2.Fields.FieldByName("PAYMENT").SetValue("-2", true);   //     ' Payment Number

                        OEORD1detail2.Fields.FieldByName("PAYMENT").SetValue("-32767", true);//      ' Payment Number


                        temp = OEORD1header.Exists;


                        Dispatch.Redirect(base.UrlDotNet("Lease.dll", "RunDataPage") + "&J=Lease Summary&T=Lease&Bak=ACCPAC Order Entry Entered.....");

                        //   OEORD1header.Cancel();

                          // OEORD1header.Init();

                         //  OEORD1detail2.Browse("", true);

                          // OEORD1detail2Fields.FieldByName("PAYMENT").SetValue("-32767",false);  //    ' Payment Number

                          // OEORD1detail2.Browse("", false);

                          // OEORD1detail2.Fetch(false);

                          // OEORD1headerFields.FieldByName("CUSTOMER").SetValue ("1100",true);  //                       ' Customer Number

                          //temp = OEORD1header.Exists;

                           //mDBLinkCmpRW = session.OpenDBLink(DBLinkType.Company, DBLinkFlags.ReadWrite);

                           //ACCPAC.Advantage.View arCustView = mDBLinkCmpRW.OpenView("AR0024");

                           //String custNum;

                           //String custName;

                           //arCustView.Fields.FieldByName("IDCUST").SetValue("1210", false);


                           //custNum = (String)arCustView.Fields.FieldByName("IDCUST").Value;

                           //custName = (String)arCustView.Fields.FieldByName("NAMECUST").Value;

                           //AddError("After Read1, Customer Number = " + custNum +

                           //     " Customer Name: " + custName);



                   //    bool gotOne = arCustView.GoTop();

                       //String custNum;

                       //String custName;

                         //  custNum = (String)arCustView.Fields.FieldByName("IDCUST").Value;

                       //   custName = (String)arCustView.Fields.FieldByName("NAMECUST").Value;

                       //  AddError("asdas22" + custNum);




                  // this.AddError(error.Message);



           private ACCPAC.Advantage.Session session;

           public void Session_Open()




                   session = new ACCPAC.Advantage.Session();

                  // session.Init("", "CS", "CS0000", "56A");

                   session.Init("", "EW", "EW9999", "56A");

                   session.Open("ADMIN", "ADMIN", "TSTDAT", DateTime.Today, 0);




                  // AddError("trest");





  • i tried your solution in this link with no result

  • and this error occurred when the message appear 

  • Fancosh

    I can see that you are trying to include some Accpac classes in a Sage CRM .NET project.  I don't know whether the Accpac libraries can be used like that.  Does the Accpac, Sage 300 ERP team provide any documentation on the use of their libraries for this purpose?

  • i am create this class and give it the name accpac and add references and start working to insert data to order entry  table in acpacc.

    see Programming/SDK in this link :

    my code work correctly but when first click the error appear then everything ok.

    i put my code in windows application project its working fine with no errors.

  • Fancosh

    I don't understand how you can say your code works but you get the error.

    I think you are using Accpac Libraries that may not be able to be called in the way you are doing.  

    What is the minimal amount of code that generates the error?  Try removing code (commenting out) until you find the line that creates the error.

  • thanks Jeff,

    i mean the error not always appear  and i try to put minimal amount of code but its appear suddenly in different line(i am not crazy this error make me crazy yes suddenly) put the error is between COM and sageWrapper  

    i tried everything with no result :/

  • I am not familiar with the use of Accpac classes.  Have you posted a question on the within the Sage CIty Sage 300 ERP forums?