cancel
Showing results for 
Search instead for 
Did you mean: 

Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)

edy_simon
Active Contributor
0 Kudos

Hi ankit.chauhan1 ,

Need your help to confirm this issue.

I encountered 1 strange issue, posting here to check if it is a bug in DI API and others can replicate.
Also i included a solution i found.

I received the Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT) error message when creating a draft object and setting any property of the draft.


Step to re-produce:

  1. Create a simple addon
    class Program
    {
        static SAPbouiCOM.Application app;
        static SAPbobsCOM.Company com;
        static void Main(string[] args)
        {
            try
            {
                SAPbouiCOM.SboGuiApi sboGui = new SAPbouiCOM.SboGuiApi();
                sboGui.Connect("0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056");
                app = sboGui.GetApplication();
                com = app.Company.GetDICompany() as SAPbobsCOM.Company;

                var rs = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset) as SAPbobsCOM.Recordset;
                //var sql = "SELECT TOP 1 DocEntry FROM ODRF";      //This one works
                var sql = "SELECT TOP 1 DocEntry FROM odrf";        //This one will throw an error when I set any property on draft object below
                rs.DoQuery(sql);


                SAPbobsCOM.Documents doc = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts) as SAPbobsCOM.Documents;
                doc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices; //The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadLine();
        }
    }

2. Clean start SBO Application (This is important, once it hit error, I was never able to create the drafts anymore and have to re-start SBO)
3. Run the addon.

Expected result:
draft document is initialized and DocObjectCode is set to oInvoice.

Current result:
Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)

The fix:
My query SELECT TOP 1 DocEntry FROM odrf

The table name must be written in capital letters 'ODRF'

Tested on version 2202 SQL and 2208SQL.
In older version, (my customer just upgraded from 92PL06) this was no issue.


Regards
Edy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi edy.simon,

I got late notification for this issue.

I will check and come back to you.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi edy.simon,

Unfortunately, I cannot reproduce this issue.

Tested in FP 2208 (MS SQL version).

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi edy.simon,

Few questions for you:

1. Are you able to reproduce it consistently?

2. Is it reproducible in all the databases on a server? Please help to check in FP2208 for all the databases.

3. What happens if you remove the RecordSet part (Initialization and Query Execution) from the code and try to create Draft normally?

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

edy_simon
Active Contributor
0 Kudos
Hi Ankit,
I tested on FP2202, FP2208 SBODemoSG database.
It is consistently having this issue.
If I removed the recordset part, I don't have issue.
If i changed the capitalization of the 'odrf' to 'ODRF', I don't have issue.

This issue only happens when (exactly per below steps):

  1. Fresh start of SBO Application
  2. After SBOApplication starts, directly execute the program.
  3. The query string (esp the table name) is in small caps.
  4. Only happens with trying to create and set the property of oDraft object. Declaring and setting of other objects (oInvoices/oOrders etc) does not exhibit this issue.
Regards
Edy
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi edy.simon,

Since, you can reproduce the issue consistently, kindly create an incident under the component SBO-SDK-DI to get it investigated.

We will need the copy of the affected database and logs (if required).

Kindly mention the link of this thread/discussion while creating the incident.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

Accepted Solutions (0)

Answers (1)

Answers (1)

avi_bandel2
Explorer
0 Kudos

HI

I'm having a similar error thrown when trying to create draft documents, upon setting the doc.DocObjectCode or doc.DocObjectCodeEx properties.

Is there a known solution to this?

mk1909_sap
Active Participant
0 Kudos
Hello dude, i was also facing the same issue. pls check this solution will help for you or not https://www.linkedin.com/feed/update/urn:li:activity:7166391771059482624 Best Regards, Mahendrakumar D.P.