cancel
Showing results for 
Search instead for 
Did you mean: 

How to use oCompany.GetCompanyList in DI API 9.2 in the login page?

former_member801815
Discoverer
0 Kudos

I have a login page and I want to display the list of Company DB available in a certain DB server. I am aware of the oCompany.GetCompanyList but how do I use it when I was just about to login?

AlexGourdet
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for visiting SAP Community to get answers to your questions.

Since you're asking a question here for the first time, I'd like to recommend you with the following steps so you can get the most out of your community membership:

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

All the best,

-Alex

Accepted Solutions (0)

Answers (1)

Answers (1)

rasmuswulff_jensen
Active Contributor
0 Kudos
Here is a code sample 
private List<Company> GetDatabasesForServer(string server, BoDataServerTypes serverType, BoSuppLangs language)
{
var result = new List<Company>();
SAPbobsCOM.Company c = new CompanyClass
{
Server = server,
DbServerType = serverType,
language = language
};
Recordset rs = c.GetCompanyList();
while (!rs.EoF)
{
string dbName = rs.Fields.Item(0).Value.ToString();
string name = rs.Fields.Item(1).Value.ToString();
result.Add(new Company(dbName, name));
rs.MoveNext();
}
return result;
}
wfletcher
Newcomer
0 Kudos

Hi @rasmuswulff_jensen, is there a way to do this with B1UP? I am using SAP B1 10.0 HANA and I keep getting an error when running this line:

c.GetCompanyList();

The error that I'm seeing is: Exception from HRESULT: 0xFFFFFFFF