business-connector

Dynamics AX 2009 Business Connector Logon

こ雲淡風輕ζ 提交于 2020-01-25 00:58:06
问题 Background: I'm currently working with the Dynamics AX 2009 Business Connector in C#. For my current project I need to connect to multiple AOS servers; ideally all in parallel, though sequentially would be adequate. I can connect to one server (any server) successfully, but always hit a LogonSystemChangedException if I try to connect to a different server (or even the same server but using null to connect to it as default instead of by specified name). I even get this error if I Logoff and

Return a list to .NET Business Connector

丶灬走出姿态 提交于 2019-12-12 03:35:37
问题 Currently, I am using the following code: Axapta ax = new Axapta(); string tableName; ArrayList ax_cont = null; ax.Logon(null, null, null, null); try { ax_cont = (ArrayList)ax.CallStaticClassMethod("Code_Generator", "tableNames"); for (int i = 1; i <= ax_cont.Count; i++) { tableName = ax_cont[i].ToString(); tablesCB.Items.Add(tableName); } } catch { } But I'm getting a type conversion exception. What do I need to do in C# when a list is returned from ax dynamics as an AxpataObject ? 回答1: It

Obtain Network Credentials from Current User in Windows Authentication Application

余生颓废 提交于 2019-12-03 11:39:59
问题 I was wondering whether it was possible to obtain the current user object and get their credentials so that I can pass them along to a NetworkCredential object which I am using to connect to my AX .NET Business Connector. As, at the moment I'm having to specify it connect as a specific user which I set when I instantiate a NetworkCredential object: private NetworkCredential nc = new NetworkCredential("myUser", "myPassword", "myDomain"); I was hoping to do something like: private

In Dynamics AX, using the Business Connector, how do you call kernel functions?

蓝咒 提交于 2019-11-29 08:00:22
I would like to know how to call kernel functions from AX using C# (.Net Business Connector). Specifically, can you call methods like fieldName2Id, tableName2Id and curUserId? I found some workarounds to calling kernel functions: tableName2Id (I was originally thinking of the tablenum method): //I used an extension method here public static int GetTableId(this Axapta ax, string tableName) { return (int)ax.CallStaticClassMethod("Global", "tableName2Id", tableName); } curUserId //Another extension method public static string CurUserId(this Axapta ax) { return (ax.CallStaticClassMethod("xUserInfo

In Dynamics AX, using the Business Connector, how do you call kernel functions?

核能气质少年 提交于 2019-11-28 01:24:03
问题 I would like to know how to call kernel functions from AX using C# (.Net Business Connector). Specifically, can you call methods like fieldName2Id, tableName2Id and curUserId? 回答1: I found some workarounds to calling kernel functions: tableName2Id (I was originally thinking of the tablenum method): //I used an extension method here public static int GetTableId(this Axapta ax, string tableName) { return (int)ax.CallStaticClassMethod("Global", "tableName2Id", tableName); } curUserId //Another