Hi, I don’t know if this is the right place to ask this question. I need (in another application then Axapta) information picked from axapta. I googled on the internet and tried the following code, but without success. I get an invalid password if I use AxaptaClass.Logon I get an “System.ArgumentException” when I use Axapta2Class.Logon2 So, nothing seems to work. I’ve checked our licenses. We have 1 license for a COM client. Any suggestions as to how I can get the COM to work? Do I need to set something in Axapta? Do I connect in the wrong way? Someone in my company had the same error, and suggested the COM server of axapta doesn’t function. Any idea’s as to how I can fix this? thx, Kathleen ********************************************** C# code : using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using AxaptaCOMConnector; namespace axaptaConnect { ///
Hi Kathleen, To start with - Has the COM Connector been registered properly? As you may be aware COM Connector can be tested from Internet ->Parameters under Admin → Setup → Internet. Is the test successful? Please let us know. Meanwhile I will also look into this code… Regards, Harish Mohanbabu
Hi, I get a result in dutch. I’ll try to translate it : Result of test of Navision Axapta Business Connector The navision axapta business connector has loaded without problems. Logon on Navision Axapta has succeeded. [Table named System information with information of where everything is located.] All tests have ended without mistakes. The Navision Axapta Business Connector should be ready for use with Navision Axapta.
Have you tried to debug the C# application to find the line where exception is thrown? [^] Is you admin account using same setting as in code you have shown, that is with no password? [:D] My code is also in C#, but is for ASP.NET application the retreives some data from Dimensions table. Here is the sample: ax = new Axapta2Class(); ax.Logon2(“User”,“Pass”,"","","","","",false,"",""); // CREATE QUERY IAxaptaObject axQuery = ax.CreateObject(“Query”,"","","","","",""); IAxaptaObject axDataSource = (IAxaptaObject)axQuery.Call(“AddDataSource”, DimensionsTable,"","","","",""); IAxaptaObject axQueryRun = ax.CreateObject(“QueryRun”, axQuery,"","","","",""); // READ RESULTS while ((bool)axQueryRun.Call(“Next”,"","","","","","")) { string Description, DimensionCode, DimensionNumber; IAxaptaRecord custTableBuffer = (IAxaptaRecord)axQueryRun.Call(“GetNo”, 1,"","","","",""); Description = custTableBuffer.get_field(“Description”).ToString(); DimensionCode = custTableBuffer.get_field(“DimensionCode”).ToString(); DimensionNumber = custTableBuffer.get_field(“Num”).ToString(); }
Hello, The line ax.Logon2(“User”,“Pass”,"","","","","",false,"",""); did the job. I tried the Logon2 before, but I did not use the false. Thx for the help! Kathleen