on 10-06-2008 2:20 PM
Hi everybody,
When I execute this:
SAPbobsCOM.UserTables oUserTables = null;
oUserTables = DICompany.UserTables;
System.Windows.Forms.MessageBox.Show(oUserTables.Count.ToString());
and this message show me the text "0"
It could not be true because I had added 6 User tables!
Everything else works fine, user forms, user menu, user event handling...
Which one could be the reason?
Regards.
--
Enriquillo Guigni
I had been searching for an other reason and I found that my Single Sign-On does not work fine:
- the DICompany doesn't connect
There is something bad with???
private bool Connect()
{
string ConnectionString = string.Empty;
string ConnectionContext = string.Empty;
string Cookie = string.Empty;
int RetCode = 0;
try
{
ConnectionString = Environment.GetCommandLineArgs().GetValue(1).ToString();
GuiApi = null;
GuiApi = new SAPbouiCOM.SboGuiApi();
GuiApi.Connect(ConnectionString);
SboApp = GuiApi.GetApplication(0);
DICompany = null;
DICompany = new SAPbobsCOM.Company();
Cookie = DICompany.GetContextCookie();
ConnectionContext = SboApp.Company.GetConnectionContext(Cookie);
if (DICompany.Connected)
{
DICompany.Disconnect();
}
}
catch (Exception Ex)
{
System.Windows.Forms.MessageBox.Show(Ex.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
Environment.Exit(0);
}
RetCode = DICompany.SetSboLoginContext(ConnectionContext);
if (RetCode != 0)
{
return false;
}
else
{
SboApp.StatusBar.SetText("NcfAddOn connection success", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
return true;
}
}
When I execute this:
oUTMD = (SAPbobsCOM.UserTablesMD)(DICompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables));
I got an error: You are not conected to a company....
Can you helpme?
--
Enriquillo Guigni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I writed this code in my add-on
Dim i As Integer = SBO_Company.UserTables.Count
Console.WriteLine("SBO_Company.UserTables.Count=" & i.ToString)
Result in output console:
SBO_Company.UserTables.Count=80
Regards
Sierdna S.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i tried it with both codes
Console.WriteLine(oCompany.UserTables.Count);
SAPbobsCOM.UserTables oUserTables = null;
oUserTables = oCompany.UserTables;
Console.WriteLine(oUserTables.Count.ToString());
and it worked for me -> correct number of UserTables.
iam tried it in SBO 2005 SP01 PL 39
just want to clarify that your code works, maybe it's a patch level problem
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.