If you have ever used the General Ledger AIF service of the Microsoft Dynamics AX 2009, you might have noticed the limitation of not integrating other than Ledger transactions. For example, you cannot send Customer and Vendor transactions through that AIF Service.
I came across a requirement where I needed to integrate external Vendor and Bank transactions through AIF. After spending sometime on testing as well as on X++ code tracing… I came to know that Microsoft is putting some restrictions on the code to not to accept the Ledger Journal transactions of types other than Ledger.
The following code is a standard X++ code that was written to prevent such integration.
37 38 39 40 41 42 43 44 45 46 47 48 49 | //LedgerJournalTableType (class) -- initializeLedgerJournalName (method) -- Line number 37 /*Commented to disable the Non-Ledger type restriction*/ if (!true /*this.isJournalNameValidJournalType()*/) /*Commented to disable the Non-Ledger type restriction*/ { AifFaultContext::setGlobalContextField(tableId, fieldId); AifFault::checkFailedLogFault(strfmt("@SYS114718", axLedgerJournalTable.parmJournalName(), axLedgerJournalTable.parmJournalType()), #InvalidJournalNameJournalTypeCombination); throw AifFault::faultList("@SYS98197", #ValidationFailed); } /*Initilizing the journal type from the journal name*/ ledgerJournalTable.JournalType = ledgerJournalName.JournalType; /**/ } |
Also I have changed:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | //Amer Atiyah, http://www.amer-ax.com/ //LedgerJournalTransType (class) -- validateAccountType (method) -- Line Number 1 protected boolean validateAccountType() { boolean isValid = true; ; switch (ledgerJournalTable.JournalType) { case LedgerJournalType::Daily : /* I had to comment this code to prevent the validation if (ledgerJournalTrans.AccountType != LedgerJournalACType::Ledger) { if (this.isConsumerStateTracked()) { // AX5 service limitation isValid = AifFault::checkFailedLogFault("@SYS117885", #AccountTypeMustBeLedger); } }*/ break; default : break; } return isValid; } |
What I like to mention in here is that Microsoft Dynamics AX 2012 now supports integrating Vendor, Customer, and Bank transactions out-of-the-box. I copied the following code from the LedgerJournalTransType class in Dynamics AX 2012 without doing any changes to it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | protected boolean validateAccountType() { boolean isValid = true; this.initializeLedgerJournalTable(); switch (ledgerJournalTable.JournalType) { case LedgerJournalType::Daily : if(LedgerJournalTrans.AccountType != LedgerJournalACType::Ledger && LedgerJournalTrans.AccountType != LedgerJournalACType::Bank && LedgerJournalTrans.AccountType != LedgerJournalACType::Vend && LedgerJournalTrans.AccountType != LedgerJournalACType::Cust) { if(this.isConsumerStateTracked()) { isValid = AifFault::checkFailedLogFault("@SYS117885", #AccountTypeIsNoSupported); } } break; default; break; } return isValid; } |
Developing applications is now easier and faster in the new Microsoft Dynamics AX 2012 than its earlier versions. .NET developers who are familiar with Visual Studio .NET will be comfortable with developing Dynamics AX applications although Dynamics AX has its own IDE which called MorphX and its own programming language with is X++.
This image shows the Dynamics AX AOT (Application Objects Tree), one of the MorphX IDE objects that Dynamics AX developers use to navigate through programming objects like Forms, Reports, and X++ Classes:

With Microsoft Dynamics AX 2012, you can view that AOT in the Microsoft Visual Studio 2012:

Dynamics AX 2012 Applicatoin Explorer in VS.NET
Proxies
Microsoft Visual Studio 2010 now creates proxies internally to support interacting with Microsoft Dynamics AX 2012 X++ classes, tables and base enums. By creating those proxies, developers will interact with Dynamics AX objects in C# and VB.NET exactly as if they are interacting with it in X++. After the proxy is created, that type is available as a strong type and features such as IntelliSense are available. For example, table fields and X++ methods are now exposed to be used in C# with one click. The created proxies are using .NET business connector internally to connect to the Dynamics AX objects.
The following pictures speak quietly how you can access and interact with Microsoft Dynamics AX 2012 objects from within Microsoft Visual Studio 2010:

Adding Visual Studio Project to the Dynamics AX 2012 AOT

Visual Studio Project inside Microsoft Dynamics AX 2012 AOT

Adding a Dynamics AX 2012 object to the VS 2010 Creates an Internal Proxy

The CustTable Appears in the Solution Explorer. You Can Now Use the Dynamics AX CustTable Methods, Properties and Fields!
Search the site
Dynamics AX 2012 Event
Recent Posts
- Enterprise Portal is Not Working on Dynamics AX 2012 Hyper-V Image
- Dynamics Academy – An Academic Project for Microsoft Dynamics in Saudi Arabia
- Microsoft Dynamics AX 2012 Event in Khubar
- Knowledge Bridge
- Columbus IT
- Fawzi Al-Nahdi and Partners Holding Group
- Dynamics AX 2009 Shows One Line Only in Its Grids
- Talal Abu-Ghazaleh
Tags
Archives
- December 2011 (2)
- November 2011 (3)
- July 2011 (2)
- June 2011 (4)
- May 2011 (3)
- April 2011 (4)
- March 2011 (12)
- February 2011 (2)
- January 2011 (3)
- December 2010 (1)
- November 2010 (1)
- October 2010 (5)
- August 2010 (1)
- July 2010 (3)
- June 2010 (4)
- May 2010 (5)
- April 2010 (1)
- March 2010 (9)
- February 2010 (4)
- January 2010 (4)
- December 2009 (11)
- September 2009 (1)
- August 2009 (1)
- July 2009 (2)
- September 2008 (1)
Random Testimonial
- ~ Mohammad A-Awami, Dynamics AX Specialist at WorleyParsons
"I worked with Amer for WorleyParsons. I found him very cooperative. He is able to help me in a lot of issues that related to ax. His ability to solve the problems is fascinating me. It is so fast and done on the best practice. His ability on business analysis and implantation are done on the best methods." - Read more testimonials »
What's the little bird saying?
- @salman_alodah لا و الله يا دكتور، لستم مملكة الانسانية 1 week ago
- Lonely and bored in #Doha #Qatar 2 weeks ago
- At the #Microsoft #opendoor in #doha 2 weeks ago
- More updates...
Posting tweet...
Powered by Twitter Tools

June 10, 2011 in