Skip to main content

Posts

Showing posts with the label Business Connector

AX 2009 - .Net business connector with a SQL statement with several joins

This is an example how to use joined tables: Axapta ax = new Axapta(); ax.Logon(null, null, null, null); using (AxaptaRecord users = ax.CreateAxaptaRecord("UserInfo"), groups = ax.CreateAxaptaRecord("UserGroupList")) { ax.ExecuteStmt("select * from %1 join %2 where %1.id == %2.userId", users, groups); while (users.Found) { Console.WriteLine("{0} ({1})", users.get_Field("id"), groups.get_Field("groupId")); users.Next(); } }

Using Dynamics 'AX .NET Business Connector' to access Dynamics AX 4.0 from .NET world

So, this is a really interesting integration aspect between AX and .NET apps. We want to access AX business logic (or data, transactions, etc.) from the .NET world. :-) Requirements Before starting to develop anything, we need to install several required components: In my case, I’ve got a single development machine where I have installed everything. I mean: - SQL Server 2005 - Dynamics AX 4.0 - AX .NET Business Connector - Visual Studio 2005 (for .NET development) - We could also install ‘ Windows SharePoint Services ’ and the ‘AX Enterprise Portal’. It also uses .NET Business Connector for accessing AX, but in this case, we are just talking about .NET and AX. I’ll maybe post about ‘AX Enterprise Portal’ and Windows SharePoint Services in another posting. J So!, the AX .NET Business Connector allows accessing Microsoft Dynamics AX from our own .NET applications as though they were a native Microsoft Dynamics AX client. So any .NET app or even ...

Dynamics Axapta: Sales Orders & Business Connector

Well, again folllowing my same idea of writting close to nothing and pasting code, I'll paste in some code to create a sales order from some basic data and the invoice it. I'll try to explain more in the future. AxaptaObject axSalesTable = ax.CreateAxaptaObject("AxSalesTable"); AxaptaRecord rcInventDim = ax.CreateAxaptaRecord("InventDim"); AxaptaRecord rcCustTable = ax.CreateAxaptaRecord("CustTable"); rcCustTable.ExecuteStmt("select * from %1 where %1.AccountNum == '" + MySalesOrderObject.CustAccount + "'"); if (MySalesOrderObject.CurrencyCode.Trim().Length == 0) MySalesOrderObject.CurrencyCode = rcCustTable.get_Field("Currency").ToString().Trim(); string sTaxGroup = rcCustTable.get_Field("taxgroup").ToString().Trim(); //set header level fields axSalesTable.Call("parmSalesName", MySalesOrderObject.SalesName.Trim()); axSalesTable.Call("parmCustAccount", M...