Skip to main content

Posts

Showing posts from July, 2012

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(); } }

ERP implementation benchmark: Comparing SAP, Oracle, and Microsoft

Summary: Recent research compares important dimensions of IT project success and failure on ERP systems from SAP, Oracle, and Microsoft Dynamics. By Michael Krigsman for IT Project Failures | July 16, 2012 -- 18:45 GMT (11:45 PDT) 4 Comments 2 Votes in Share more + Email Print Google+ Del.icio.us Digg StumbleUpon Reddit Technorati Pinterest Slashdot A recent survey (PDF download) by Panorama Consulting Solutions compares important dimensions of IT project success and failure with respect to ERP systems from SAP, Oracle, and Microsoft Dynamics. Photo credit: "Choosing the colors of ERP" by Michael Krigsman According to the report, the data set consists of over 2000 respondents from 61 countries who have selected or implemented SAP, Oracle or Microsoft Dynamics ERP solutions between February 2006 and May 2012. Also Read: Study: 68 percent of IT projects fail CRM failure rates: 2001-2009 Who's accountable for IT failure? (part one) Who's accountable...

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 ...

Creating Free Text Invoice through X++ code

Job: Calling class from job to run the class public void freeTextInvoicePostTestJob() { Dialog dialog; DialogField dlgCustAcc; DialogGroup dialogPeriodLengthGroup, dialogPeriodLengthGroup1; DialogField dlgLedgerAcc; ; dialog = new Dialog("Free-Text Invoice"); dialogPeriodLengthGroup1 = dialog.addGroup('Cust Table'); dlgCustAcc = dialog.addField(typeid(CustAccount)); dialogPeriodLengthGroup = dialog.addGroup('Ledger Table'); dlgLedgerAcc = dialog.addField(typeid(LedgerAccount)); if(dialog.run()) { if(dlgCustAcc.value() && dlgLedgerAcc.value() != '') FreeTxtInvoiceCreatePost::main(dlgCustAcc.value(), dlgLedgerAcc.value()); else throw error(strfmt("Either CustAccount or LedgerAccount info is missing.")); } } Class: Which creates the free text invoice class FreeTxtInvoiceCreatePost { } static void main(CustAccount _custAccount, LedgerAccount _ledgerAccount) { CustInvoiceTable custInvoiceTable; ...

Call your Ax customization from Visual Studio C# code

How about calling your Axapta customizations (Classes / Class & Table methods / Enums) from your EP User control? For this you need your X++ code resources available for use in Visual Studio. A proxy can do it for you. Ax already has this proxy defined for you as Proxies static file that is maintained in the AOT. You need to add references for your classes, methods or enums that you want to access from User Controls to this existing proxy. Step 1 Add to the proxy In the AOT, Go to Web --> Web Files --> Static Files --> Proxies file Right-click the Proxies file, and then click Edit. Use the Web Application Editor to add definitions for the additional items that you want to include in the proxy. You can use the existing items in the proxy as a template for how to add more items. To add an enum, use the following syntax. /enum:EnumName To add a class that has methods, use the following syntax. /class:ClassName /method:ClassName.MethodName To add ...

Dynamics Ax Virtual Company & Table Collections

This article describes how Dynamics Ax Virtual Company and Table Collection work. We will also discuss how to move data from normal company to virtual company when you introduce virtual company in existing Ax implementation. Virtual Company: Dynamics Ax stores data as per company in tables. But there might be occasions when you want to share data across companies, like country, state, zip codes data. This sharing of data is achieved by creating a virtual company and storing data in this virtual company. Normal companies are then configured to read/write data from this virtual company. The only purpose of virtual company is to share data across companies, you cannot log into this virtual company. Before seeing how to do virtual company setup, I would like you to show another trick that can be used to share data across Ax. There is a property on Ax tables called " SaveDataPerCompany ", you can use this property to save data globally in Ax. To share data set ...

ActiveX Gantt Chart control in Dynamics Ax

This article exposes the very less used but two very important features; Gantt Chart Reporting (data analysis based on different kind of scheduling jobs) and use of ActiveX controls in Dynamics Ax . I hope you all understand what we can achieve through Gantt Charts. And ActiveX controls are small programs that provide add-on functionality to your application, usually it provides a GUI which can be placed on your forms / reports. Note: This article is for advance Dynamics Ax users. Dynamics Ax uses a third party ActiveX control to implement Gantt Charts. The ActiveX control is from NETRONIC, called VARCHART XGantt version 4.1. So, for our Gantt Chart we will use this ActiveX, this way you will also understand " How to use third party ActiveX controls in Dynamics Ax? ". For reference, see below to know where this Gantt Chart ActiveX control is used in Dynamics Ax... Open Project--Project Details form, click Activities button, on Hierarchy form click ...

Write into the System Event Viewer from Dynamics AX

This is a very short article which shows how to write any information into the system event viewer. This is something that can be very useful when trying to debug processes such as batches that are difficult to debug. One thing to note is that if the code is running on the AOS the information will be written to the EventViewer on the AOS, just something to keep in mind if you don’t see your message in the EventViewer. static void writeEventLogEntry(Args _args) { System.Diagnostics.EventLog eventlog; #Define.LogSource( "Dynamics AX" ) #Define.LogName( "Application" ) ; // check if the log already exists if (!System.Diagnostics.EventLog::SourceExists(#LogSource)) { // create new log System.Diagnostics.EventLog::CreateEventSource(#LogSource, #LogName); } eventlog = new System.Diagnostics.EventLog(); eventlog.set_Source(#LogSource); // write info entry eventlog.WriteEntry( " : Just writing in the event viewer." ); // write error entry eventlog.Write...

Convert Dynamics AX Entity Private Address into Public GAB Address

In this article, we will see how to convert Customer / Vendor's private addresses into public GAB addresses. If you try to do it manually by clicking the public check box on a private address then it will just not allow you to do it. Here is the code to do so: 1: //Converts private addresses to public addresses 2: static void ConvertPrivateAddressToPublic(Args _args) 3: { 4: #OCCRetryCount 5: DirPartyAddressRelationshipMapping dirPartyAddressRelationshipMapping; 6: Address address, address2; 7: DirParty dirParty; 8: DirPartyTable dirPartyTable; 9: 10: void convertAddress() 11: { 12: ; 13: address.clear(); 14: address = Address::findRecId(address2.RecId, true ); 15: 16: //dir party associated with the entity 17: dirParty = DirParty::constructFromCommon(address); 18...