on 03-30-2023 1:55 AM
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:
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.