Advertisement

Tip Jar:

One-Time Donation

Recurring Monthly $2 Donation Appreciated

The tip jar is to help contribute to keeping this site going. If you like what you see... feel free to help out!

Microsoft Dynamics AX 2009 White Paper: Integrating a Third Party Version Control System into Microsoft Dynamics AX 2009

Go directly to Source

A new white paper has been published on how to intergrate a third party version control system with AX2009. The white paper is a case study of the steps the MorphX team had to go through in order to integrate Team Foundation Server (TFS) into AX2009.  


The white paper is available for download at these locations:


Microsoft Download Center:
http://www.microsoft.com/downloads/details.aspx?FamilyID=48f803fc-5ded-44a8-a442-e499f2db6382


CustomerSource:
https://mbs.microsoft.com/customersource/documentation/whitepapers/ax2009_integratingthirdpartyvcs


PartnerSource:
https://mbs.microsoft.com/partnersource/deployment/documentation/whitepapers/ax2009_integratingthirdpartyvcs


Make sure to visit the author of this post!

Microsoft Dynamics AX 2009 White Paper: Integrating a Third Party Version Control System into Microsoft Dynamics AX 2009

Go directly to Source

A new white paper has been published on how to intergrate a third party version control system with AX2009. The white paper is a case study of the steps the MorphX team had to go through in order to integrate Team Foundation Server (TFS) into AX2009.  


The white paper is available for download at these locations:


Microsoft Download Center:
http://www.microsoft.com/downloads/details.aspx?FamilyID=48f803fc-5ded-44a8-a442-e499f2db6382


CustomerSource:
https://mbs.microsoft.com/customersource/documentation/whitepapers/ax2009_integratingthirdpartyvcs


PartnerSource:
https://mbs.microsoft.com/partnersource/deployment/documentation/whitepapers/ax2009_integratingthirdpartyvcs


Make sure to visit the author of this post!

Optional parameters in C# and X++

Go directly to Source

In the upcoming 4.0 version of C# the language now supports optional parameters – just like X++. The following is a valid method declaration in both languages:


public void foo(int parameter1, int parameter2 = 0, int parameter3 = 100)
{
}

There are a few differences between the languages with regards to optional parameters:


Named parameters


In X++ you can only omit optional parameters starting from the last parameter. C# makes it possible to omit any optional parameter. For example:


foo(5, parameter3: 1000)

will call foo(5, 0, 1000).


prmIsDefault


C# doesn’t provide a way to determine, if a parameter was omitted by the caller, or the caller passed in a value identical to the default value. In X++ the prmIsDefault() method can be used to determine this. However, the use cases for this method are rare – and often fragile. For example, consider this X++ class:


class BaseClass
{
    int value;
    public void init(int _value = 0)
    {
        if (prmIsDefault(value))
        {
            value = /* some complex calculation */
        }
        else
        {
            value = _value;
        }
    }
}
Now someone comes along and extends the class:
class MyClass extends BaseClass
{
    str myStr;
    public void init(int _value = 0)
    {
        myStr = ‘foo’;
        super(_value);
    }
}
Can you see the problem? This following code will never call the complex calculation (which probably was the intention):
MyClass myClass = new MyClass();
To solve the problem MyClass needs to be implemented as:
class MyClass extends BaseClass
{
    str myStr;
    public void init(int _value = 0)
    {
        myStr = ‘foo’;
        if (prmIsDefault(_value))
            super();
        else
            super(_value);
    }
}

Which really is terrible, as the implementation of the derived class depends on the implementation of the base class. This is bound to break eventually. Add a few more optional parameters and a few more levels of depth in the class hierarchy, and you’ll have a real nightmare. My recommendation is to only use prmIsDefault() in private and final methods – as they can’t be overridden. In C# you can easy live without this method, as you can achieve the same in a more robust manner using method overloading:


class BaseClass
{
    int value;
    public void init()
    {
        int _value = /* some complex calculation */
        this.init(_value);
    }
    public void init(int _value)
    {
        value = _value;
    }
}
<humor>It is a good thing we solved the dangling semicolon issue – otherwise it would haunt the C# community in a not too distant future.</humor>


Make sure to visit the author of this post!

Optional parameters in C# and X++

Go directly to Source

In the upcoming 4.0 version of C# the language now supports optional parameters – just like X++. The following is a valid method declaration in both languages:


public void foo(int parameter1, int parameter2 = 0, int parameter3 = 100)
{
}

There are a few differences between the languages with regards to optional parameters:


Named parameters


In X++ you can only omit optional parameters starting from the last parameter. C# makes it possible to omit any optional parameter. For example:


foo(5, parameter3: 1000)

will call foo(5, 0, 1000).


prmIsDefault


C# doesn’t provide a way to determine, if a parameter was omitted by the caller, or the caller passed in a value identical to the default value. In X++ the prmIsDefault() method can be used to determine this. However, the use cases for this method are rare – and often fragile. For example, consider this X++ class:


class BaseClass
{
    int value;
    public void init(int _value = 0)
    {
        if (prmIsDefault(value))
        {
            value = /* some complex calculation */
        }
        else
        {
            value = _value;
        }
    }
}
Now someone comes along and extends the class:
class MyClass extends BaseClass
{
    str myStr;
    public void init(int _value = 0)
    {
        myStr = ‘foo’;
        super(_value);
    }
}
Can you see the problem? This following code will never call the complex calculation (which probably was the intention):
MyClass myClass = new MyClass();
To solve the problem MyClass needs to be implemented as:
class MyClass extends BaseClass
{
    str myStr;
    public void init(int _value = 0)
    {
        myStr = ‘foo’;
        if (prmIsDefault(_value))
            super();
        else
            super(_value);
    }
}

Which really is terrible, as the implementation of the derived class depends on the implementation of the base class. This is bound to break eventually. Add a few more optional parameters and a few more levels of depth in the class hierarchy, and you’ll have a real nightmare. My recommendation is to only use prmIsDefault() in private and final methods – as they can’t be overridden. In C# you can easy live without this method, as you can achieve the same in a more robust manner using method overloading:


class BaseClass
{
    int value;
    public void init()
    {
        int _value = /* some complex calculation */
        this.init(_value);
    }
    public void init(int _value)
    {
        value = _value;
    }
}
<humor>It is a good thing we solved the dangling semicolon issue – otherwise it would haunt the C# community in a not too distant future.</humor>


Make sure to visit the author of this post!

Review of: Microsoft Dynamics AX 2009 Programming: Getting Started

Go directly to Source


This is an excellent book for getting started with AX. The book’s language is straight forward and simple, so you don’t need a computer science education to reap the gold nuggets buried inside.


The first half of the book is a case study of a step-by-step implementation of a car rental application. This is a great idea, as these steps take you through many areas of AX development, and on the way introduces you to most of the building blocks of X++. The approach used is to jump straight into the action, without spending many words on background information, which quite impressively doesn’t make the material harder to grasp, but rather makes the book a pleasant and easy read. The book is full of source code examples and screenshots, which will make it easy for you to follow the same steps in your own AX installation.


The second half of the book is a collection of standalone chapters. I particularly liked the chapter on integration with various AX modules. This chapter provides a 10,000 feet overview of the main modules in AX, such as GL, AR, AP and Inventory. Further it provides code samples on how common customizations can be implemented.


There are two kinds of books. Those that struggle to reach the final page count by cutting the original manuscript, and those that struggle to produce enough pages to justify calling it a book. (Something similar is true for sauces). This book is of the latter kind, which is a shame. Important information even for beginners is missing in critical places; whereas plenty of pages are spent on low value information. For example, the book contains a 10 page source dump of an data export/import feature the author has implemented – not because the one already in AX isn’t good enough, but simply because he could.


The vital information that is missing is the primary reason I cannot give this book 5 stars. Here are some examples: In the same chapter the book explains the benefits (speed) of using set-based data base operations, and the powers of overriding table trigger methods like insert() and update() – but the book forgets to mention that overriding such a method will reduce all set-based operations to row-by-row operations on the AOS (incredibly slow in comparison). This cause and effect is one of the typical reasons AX customers are having performance problems. Similarly the book explains the concurrency model of AX4 (pessimistic) and not the concurrency model of AX2009 (optimistic). Another important topic not covered is how to develop a 3 tier application – without such information it is hard to write an application that scales beyond a few users.


It is clear that the author has worked with AX for a long time. Some of the information provided is outdated in AX2009. For example, the chapter on how to create a web service in AX explains all the hassle you had to go through in AX4, instead of explaining how simple the same could be achieved in AX2009 using the Services node in the AOT. The same is true for the BC.Net examples that use the AX4 way of talking to AX, instead of using the automatically generated proxies available in AX2009, which are much simpler to use – and much more reliable.


Finally, the technical accuracy of the book is high – it rarely state something that is wrong, but often omits what I believe is critical information. So kudos to the author. However; the editors of the book didn’t do a very good job. The book is full of typos, double words, poorly phrased sentences and what appears to be copy-paste errors. And I do mean full – I spotted one on almost every other page. It is clear that no one took the time to read the book end-2-end before printing it. For example, the appendix with useful web links has half of the URLs wrong – they are duplicates from the previous page and don’t match the description at all.


I’m giving this book a 4 out of 5 star rating, because it does deliver what it promises: A quick start on developing in AX without providing too much background information.


The book is written by Erlend Dalen and published by Packt Publishing.


Make sure to visit the author of this post!

Review of: Microsoft Dynamics AX 2009 Programming: Getting Started

Go directly to Source


This is an excellent book for getting started with AX. The book’s language is straight forward and simple, so you don’t need a computer science education to reap the gold nuggets buried inside.


The first half of the book is a case study of a step-by-step implementation of a car rental application. This is a great idea, as these steps take you through many areas of AX development, and on the way introduces you to most of the building blocks of X++. The approach used is to jump straight into the action, without spending many words on background information, which quite impressively doesn’t make the material harder to grasp, but rather makes the book a pleasant and easy read. The book is full of source code examples and screenshots, which will make it easy for you to follow the same steps in your own AX installation.


The second half of the book is a collection of standalone chapters. I particularly liked the chapter on integration with various AX modules. This chapter provides a 10,000 feet overview of the main modules in AX, such as GL, AR, AP and Inventory. Further it provides code samples on how common customizations can be implemented.


There are two kinds of books. Those that struggle to reach the final page count by cutting the original manuscript, and those that struggle to produce enough pages to justify calling it a book. (Something similar is true for sauces). This book is of the latter kind, which is a shame. Important information even for beginners is missing in critical places; whereas plenty of pages are spent on low value information. For example, the book contains a 10 page source dump of an data export/import feature the author has implemented – not because the one already in AX isn’t good enough, but simply because he could.


The vital information that is missing is the primary reason I cannot give this book 5 stars. Here are some examples: In the same chapter the book explains the benefits (speed) of using set-based data base operations, and the powers of overriding table trigger methods like insert() and update() – but the book forgets to mention that overriding such a method will reduce all set-based operations to row-by-row operations on the AOS (incredibly slow in comparison). This cause and effect is one of the typical reasons AX customers are having performance problems. Similarly the book explains the concurrency model of AX4 (pessimistic) and not the concurrency model of AX2009 (optimistic). Another important topic not covered is how to develop a 3 tier application – without such information it is hard to write an application that scales beyond a few users.


It is clear that the author has worked with AX for a long time. Some of the information provided is outdated in AX2009. For example, the chapter on how to create a web service in AX explains all the hassle you had to go through in AX4, instead of explaining how simple the same could be achieved in AX2009 using the Services node in the AOT. The same is true for the BC.Net examples that use the AX4 way of talking to AX, instead of using the automatically generated proxies available in AX2009, which are much simpler to use – and much more reliable.


Finally, the technical accuracy of the book is high – it rarely state something that is wrong, but often omits what I believe is critical information. So kudos to the author. However; the editors of the book didn’t do a very good job. The book is full of typos, double words, poorly phrased sentences and what appears to be copy-paste errors. And I do mean full – I spotted one on almost every other page. It is clear that no one took the time to read the book end-2-end before printing it. For example, the appendix with useful web links has half of the URLs wrong – they are duplicates from the previous page and don’t match the description at all.


I’m giving this book a 4 out of 5 star rating, because it does deliver what it promises: A quick start on developing in AX without providing too much background information.


The book is written by Erlend Dalen and published by Packt Publishing.


Make sure to visit the author of this post!

Turn off regular expressions in TextBuffer

Go directly to Source
When you work with objects of the TextBuffer class they use regular expressions internally when applying operations on the text. So this example probably wouldn’t perform as you’d expect, since “<” is a control character used by the regular expression…(read more)
Make sure to visit the author of this post!

Turn off regular expressions in TextBuffer

Go directly to Source
When you work with objects of the TextBuffer class they use regular expressions internally when applying operations on the text. So this example probably wouldn’t perform as you’d expect, since “<” is a control character used by the regular expression…(read more)
Make sure to visit the author of this post!

Import data from InfoPath forms to AX 4.0

Go directly to Source
Here is a very high-level description on how you can import data from an InfoPath form to AX 4.0: Create the AX web service you want to use (e.g. to create a sales order) Create a new InfoPath form Define the web service as data source in InfoPath and…(read more)
Make sure to visit the author of this post!

Import data from InfoPath forms to AX 4.0

Go directly to Source
Here is a very high-level description on how you can import data from an InfoPath form to AX 4.0: Create the AX web service you want to use (e.g. to create a sales order) Create a new InfoPath form Define the web service as data source in InfoPath and…(read more)
Make sure to visit the author of this post!

« Previous PageNext Page »

MCP Logos