Hi,
I am using the following code in my program.cs
Application oApp = null; if (args.Length < 1) { oApp = new Application(); } else { oApp = new Application(args[0]); } Menu MyMenu = null; MyMenu = new Menu(); oApp.Run();
and this others lines are used to connect to SBO
private void SetApplication() { SAPbouiCOM.SboGuiApi SboGuiApi = null; string sConnectionString = null; SboGuiApi = new SAPbouiCOM.SboGuiApi(); // sConnectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056"; if (Environment.GetCommandLineArgs().Length > 1) { sConnectionString = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1)); } else { sConnectionString = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(0)); } try { SboGuiApi.Connect(sConnectionString); } catch (Exception ex) { SBO_Application.StatusBar.SetText(ex.Message,BoMessageTime.bmt_Long,BoStatusBarMessageType.smt_Error); System.Environment.Exit(0); } SBO_Application = SboGuiApi.GetApplication(-1); }
I this give me in release mode after create my .ard file and installed in SAP B1 this error:
"attempt was made to reference a token that does not exist"
I debug it and this error occurs in this line:
SboGuiApi.Connect(sConnectionString);
what is wrong with my code?
Regards.