Skip to Content
author's profile photo Former Member
Former Member

The Server threw an exception from HRESULT: 0x80010105 (RPC_E_SERVER_FAULT)

Hello experts,

below i try to report some pieces of my code:

private void creaMRP()

{

try {

while (i < resultQueryMain.Count)

{

ret = elaboraTransazione(ref i);

}

}

catch (Exception ex)

{

SwissAddonFramework.UI.Dialogs.MessageBox.Show("Errore Imprevisto: " + ex.Message, "OK");

}

finally

{

if (docOrdineCliente != null)

{

while (System.Runtime.InteropServices.Marshal.ReleaseComObject(docOrdineCliente) != 0) ;

docOrdineCliente = null;

}

if (docOrdineFornitore != null)

{

while (System.Runtime.InteropServices.Marshal.ReleaseComObject(docOrdineFornitore) != 0) ;

docOrdineFornitore = null;

}

}

}

private int elaboraTransazione(ref int i)

docOrdineCliente = (Documents)B1Connector.GetB1Connector().Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);

...

...

...

for (int j = 0; j < docOrdineFornitore.Lines.Count; j++)

{

if (docOrdineCliente.Update() != 0) // -> HERE I GET THE ERROR < -

{

SwissAddonFramework.UI.Dialogs.MessageBox.Show("Errore Imprevisto: " + B1Connector.GetB1Connector().Company.GetLastErrorDescription() + " " + B1Connector.GetB1Connector().Company.GetLastErrorCode(), "OK");

throw new Exception("errore in aggiornamento ordine cliente: " + B1Connector.GetB1Connector().Company.GetLastErrorDescription() + " " + B1Connector.GetB1Connector().Company.GetLastErrorCode());

}

}

can someone help me to fix it ?

thanks in advance.

Best regards

Andrea

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 07, 2010 at 09:18 AM

    Hi Andrea,

    probably you use not only the SAP Business One SDK and .NET Framework but also the Coresuite Framework. It is right?

    The prefix RPC refers to "Remote Procedure Call". Probably is an error Thrown by a Coresuite library.

    If you post all the exception text and also the line reference of the exception, probably we can better help you.

    Carmine

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 07, 2010 at 10:40 AM

    the error I got could be linked with releasing COM object ?

    I'm using the below code not inside the "elaboraTransazione" method but outside in the calling method "creaMRP".

    if (docOrdineCliente != null)

    {

    while (System.Runtime.InteropServices.Marshal.ReleaseComObject(docOrdineCliente) != 0) ;

    docOrdineCliente = null;

    }

    if (docOrdineFornitore != null)

    {

    while (System.Runtime.InteropServices.Marshal.ReleaseComObject(docOrdineFornitore) != 0) ;

    docOrdineFornitore = null;

    }

    Andrea

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2010 at 11:02 AM

    Hi Andrea.

    I've been through this error that but in loop to insert invoices.

    Place a collector of memory in your loop to see if it solves. For example, in. Net I use the GC.Collect ().

    Kind regards,

    Fábio.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 08, 2010 at 12:14 PM

    Andrea,

    Check the following threads

    tips:

    1. You will find 2 notes inside, check them

    2. Check the database response time and run (sp_updatestats)

    I have seen in your code:

    docOrdineFornitore.Lines.UserFields.Fields.Item("U_OrdEntry").Value = resultQueryMain<i>["DocEntry"].ToString();
    docOrdineFornitore.Lines.UserFields.Fields.Item("U_OrdLine").Value = resultQueryMain<i>["LineNum"].ToString();

    Change them by by sap note 1235603 and it will work

    Regards,

    János

    Edited by: János Nagy on Apr 8, 2010 2:17 PM

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello János,

      the Sap Note: 1234122 shows me the following message:

      "The requested SAP Note is either in reworking or is released internally only "

      I applied everythings suggested in Sap Note n.1235603 but I still have the same error message!

      I changed the two lines as below:

      SAPbobsCOM.Document_Lines dl = docOrdineFornitore.Lines;

      SAPbobsCOM.Field uf1 = dl.UserFields.Fields.Item("U_OrdEntry");

      uf1.Value = resultQueryMain["DocEntry"].ToString();
      SAPbobsCOM.Field uf2 = dl.UserFields.Fields.Item("U_OrdLine");
      uf2.Value = resultQueryMain
      ["LineNum"].ToString();

      What can I try to solve the issue ?

      Is this a bug of SAP B1 ? I'm using SAP B1 2007 A (8.00.231) SP:01 PL:06 HOTFIX1

      Many Thanks

      Regards

      Andrea

  • author's profile photo Former Member
    Former Member
    Posted on Apr 16, 2010 at 10:19 AM

    probably the cause of this error is related with wrong data created via DI API

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 14, 2010 at 10:51 AM

    Hi Andrea Gigliotti ,

    I thing you are using SwissAddonFramework.Can u explain me what this framework do.

    i send one mail to u.please check it.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.