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
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
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
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