Skip to Content
avatar image
Former Member

C#: Simple - but difficult - Get JournalEntries

SAPbobsCOM.Company vCompany = new SAPbobsCOM.Company();

vCompany.CompanyDB = "SBODemo_US";

vCompany.Password = "manager";

vCompany.UserName = "manager";

vCompany.Server = "SBO";

vCompany.Connect();

if (oCompany.Connected)

{

lblinfo.Text = "Connected to SBO";

}

else

{

lblinfo.Text = "Not connected to SBO";

}

SAPbobsCOM.JournalEntries JournalEntries;

JournalEntries = oCompany.GetBusinessObject(vJournalEntries); <---

I get a "The name 'oJournalEntries' does not exist in the class or namespace 'SAPbobsCOM_1.form1'

I've done this in VB6 but I'm kinda lost here in C#.NET.

Anyone can give a helping hand? F.x. an example on how to make a form - with a grid. When you load the form it fills the grid with for instance the journalEntries - the LedgerTable or whatever.

Thanks in advange.

TBR Allan.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 16, 2004 at 08:42 AM

    Correction - the last line is ofcourse:

    where oCompany is mentioned - read vCompany instead...

    and the last line is:

    JournalEntries = vCompany.GetBusinessObject(oJournalEntries); <---

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      You may want to explicitly cast the object returned from your vCompany and fully qualify the BoObjectTypes enum.

      Something like this:

      JournalEntries = (SAPbobsCOM.JournalEntries)vCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries);