Moving to Lyngby
How to get the AX info infolog value in ax 2009 / 2012 Exception handling example.
{
CustTable cust;
int i;
CustProjErrorStack custProjErrorStack;
;
try{
while select cust where cust.ABC_Approval != noyes::Yes
{
if(CustTable::find(cust.AccountNum))
{
}
}
}
catch(exception::Error)
{
for (i=1; i<=infolog.line(); i++)
{
custProjErrorStack.ErrorType = ErrorType::Error;
custProjErrorStack.Message = infolog.text(i);
custProjErrorStack.insert();
}
}
}
Dynamics AX 7 Development with Visual Studio
I saw this video on you tube and thought to share with you. This video demonstrates how to use Visual Studio to create a Dynamics AX 7 Project and Add an EDT in AX without MorphX as we all know by now MorphX is taken out in AX 7.
Good video and thanks for sharing
https://www.youtube.com/watch? v=05KsvTcmySs&list= PLIh45kooHi8fcPZIAF8zosVaOGg0l l-D9&index=4
Settlements (Technical Utility methods)
Piece of code that checks if the invoice is already marked with some payment or not
protected boolean checkIfAlreadyMark(CustVendTransOpen _custVendTransOpen)
{
specTransManager specTransManager = specTransManager::construct(_custVendTransOpen);
return specTransManager.existForOtherSpec(_custVendTransOpen.company(), _custVendTransOpen.TableId, _custVendTransOpen.RecId);
}
Piece of code that settles the invoice with the payment
protected void markSettlement(CustVendTransOpen _custVendTransOpen)
{
CustVendOpenTransManager manager = CustVendOpenTransManager::construct(ledgerJournalTrans);
manager.updateTransMarked(_custVendTransOpen, true);
}

Reimagining Business Applications with Microsoft Dynamics AX
Announcing Cumulative Update 10 for Microsoft Dynamics AX 2012 R3
Microsoft Dynamics AX 2012 R3 CU10 is now available to our customers for download on Lifecycle Services, CustomerSource and PartnerSource. Cumulative Update 10 build number is 6.3.3000.110. To download CU10 from LCS, select an R3 project and click the updates tile. For installation instructions, download the Installation guide for cumulative update 10 for Microsoft Dynamics AX 2012 R3. For more information, see here. |
Announcing support for Team Foundation Server 2015 with AX 2012 R2 and R3
Here's an announcement from Microsoft re. TFS 2015 support with AX 2012
http://blogs.technet.com/b/dynamicsaxse/archive/2015/11/21/announcing-support-for-team-foundation-server-2015-with-ax-2012-r2-and-r3.aspx
X++ in AX7
These days the veil is being lifted at Convergence in Barcelona for the upcoming release of AX. This is the cue to bloggers to start spreading the word: AX7 is coming!
I'm addicted to AX; it's been a major part of my entire professional life. As a developer that means I spend my days writing X++ code – the past few years on the AX7 platform. And life is simply more fun.
X++ developer – the AX7 way I'll write a blog post on a new feature in X++ in AX7 every day between now and Christmas.
#AX7 |
THIS POST IS PROVIDED AS-IS AND CONFERS NO RIGHTS
X++ in AX7: The var keyword
This is the new language feature that is generating most discussions. Just like C# you can now use the var keyword when declaring variables. It has the exact same semantics, and any guideline you will find on how to use it in C# will also apply in X++.
In C# the var keyword was introduced to enable scenarios where declaring the type was impossible, near-impossible or irrelevant, like with anonymous types and generics. Writing less was naturally well received by a lot of developers, and the use of var blossomed. It is also a great topic for steering up a debate. There are lots of guidelines and opinions. They cover the entire range from one extreme: "Always use it, it makes code easier to read" to the opposite extreme: "Never use it, it makes code harder to read".
X++ does not support anonymous types or generics in AX7 - so the real need for the var keyword is not present - yet it is supported, and already heavily used. Like in C# the use of var is as strongly typed as when the type is explicitly provided. |
Personally, I'm recommending using var in only two cases:
- When the type is obvious.
In X++ there is a lot of repetition. The var keyword can help avoid some of this clutter while making the code easier to read, without any information gets lost to the reader.
For example:MyClass myClass = new MyClass();
In AX7 I would write:
var myClass = new MyClass(); - When the type is irrelevant.
Sometimes you don't care about the type. If you don't care the reader most likely doesn't either.
For example:
ListEnumerator enumerator = myCollection.getEnumerator();In AX7 I would write:
var enumerator = myCollection.getEnumerator();
There are a number of X++ specific reasons to not use var (i.e. doesn't apply to C#)
- Limited support Visual Studio.
In the X++ editor in Visual Studio, you can use F12 to go to the declaration of a type. However, the X++ editor is still not as smart as the X++ compiler. At the time of this writing you are losing this drill through capability when not explicitly specifying the type of the variable. The same applies for IntelliSense – when using the var keyword, IntelliSense is not available (yet). - Higher risk of runtime errors.
Just like the C# compiler, the X++ compiler will determine the type from the assignment to the variable and enforce all the same rules and restrictions. So you might think that the use of var doesn't lead to more runtime errors. There is a catch in X++ - you should be aware of. The X++ compiler doesn't enforce any validation of method invocations on object or common. So if the X++ compiler determines the type to be object or common, then you lost your safety net. It is not always obvious.
Consider this code:
CustTable custTable = Xml2Record(xml);
custTable.someInvalidMethod(); // Compile errorUsing var, the code becomes:
var custTable = Xml2Record(xml);
custTable.someInvalidMethod(); // No compile error, as Xml2Record() returns a common
THIS POST IS PROVIDED AS-IS AND CONFERS NO RIGHTS
X++ in AX7: Finally and using
Finally, X++ got support for the finally statement. It has exactly the same semantics as in C#. This means that you can now write: try The contents of the finally block is guaranteed to be executed - regardless of exceptions or transactions. It is typically used to clean up any usage of none-managed resources. And to make that construct even cleaner, you can use the using keyword for types implementing the System.IDisposable interface. using(var myObject = new MyObject()) This is short hand for: var myObject = new MyObject(); One more thing…Just like in C# the using statement can also be used to avoid providing fully qualified names when referencing .NET types. This means I can implement MyObject like this: using System;
THIS POST IS PROVIDED AS-IS AND CONFERS NO RIGHTS |