Wednesday, December 28, 2011

WALKTHROUGH - Creating Fact Boxes in AX 2012 - PART I

Hi There!


I hope everybody had a great holiday weekend, and that you are preparing for next weekend’s big new year’s party (if you have one).
Before the end of the year I would like to highlight some of the changes that AX 2012 has when creating new Forms through a basic small project (Auto Rental).  As we you already know, Forms in AX 2012 contain FactBoxes, which is a small selection of data related to the current record in a Form List Page template.  
The goal of these set of posts is to (1) create three extended data types (EDT), (2) create four tables, (3) create relationships on the EDTs, (4) create a simple form to display the Auto Rental Data, (4) add a menu item to the Customer Details List Page to access the Auto Rental forms, (5) add controls to a form, and (6) create the relationship between the customer and Auto Rental records in a FactBox.
For now let’s focus on a few new definitions we’ll use a lot when creating FactBoxes in AX 2012 Forms. Basically, we can have three types of FactBoxes, (1) InfoPart, (2) Form Part, and (3) Cues.


1-      Info Part: This has its own data source and a number of controls. It is limited in what can be displayed. However it is simple and quick to create, and can also be displayed in the Enterprise Portal.


2-      Form Part: This is a link to a form. The form can have the same controls as a standard form. However since this is displayed in the FactBox section of the list page, adding too many controls can crowd the part.


3-      Cues: This is a count of a number of records related to the current record in the list page. For example, it might show the number of outstanding invoices for a customer.

In AX 2012, most forms have at least one factbox on the right side of the form. They will contain information pertaining to a highlighted record on a grid. But sometimes, we would like to see other in one of these boxes.

Go to http://msdn.microsoft.com/en-us/library/gg847986.aspx for more information about fact boxes.

Now, to create a FactBox there are a few things we need to have in place before displaying the right data. In fact, we need to have a good concept around indexes, tables and form relationships, Form Parts and their EDT relationships.
Let’s start the project by creating a basic Table Relationship diagram.


 

The diagram above is really simple. Basically we have the following:
1-    AutoRentalVehicleTypeTable , which is a table to store types of vehicles  (i.e. Compact, Mid-Size, etc.).

2-   AutoRentalVehicleMake , which is a table to store the make of a vehicle (i.e. Ford, Toyota, etc.)

3-   AutoRentalModels, which is a table that a store the vehicle models and at the same time relates to both the AutoRentalVehicleMake Table and the AutoRentalVehicleTypeTable.

4-   Finally, we have the AutoRentalCustCarTable where we store the car rental information based on a rental ID and the customer account. This table has a relationship to the AutoRentalModels Table.
In my next post we will create the four tables mentioned above along with new fields, indexes and relationships.
Take Care!

Friday, December 23, 2011

10 biggest ERP software failures of 2011

Hi there!

A new year is coming and I'm sure that all of us are looking forward to new challenges, career advancement, and the confidence that Microsoft Dynamics AX is providing our customer with a great product.

Based on a Computer World Magazine article, SAP, Epicor and Ingram Micro are having a few issues implementing their products around the world. Further, the article points out all the difficulties, legal issues and lack of vision that these ERP products are presenting to their customers.

I believe that these vendors are taking the right steps to address the problems they are having, but at the same time, I feel we have an advantage as Microsoft Dynamics AX is THE BEST ERP package in the market right now, plus is backed up by a solid network of professionals, like you and me, that are passionate about providing the best customer satisfaction.

The following picture shows the Magic Quadrant, where AX has been positioned in the leaders quadrant.





I feel confident that I'm in the right market working with the right product, and if are not so sure, I invite you to read the the article as well.

http://www.computerworld.com/s/article/9222864/10_biggest_ERP_software_failures_of_2011?source=CTWNLE_nlt_entsoft_2011-12-22&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+computerworld%2Fs%2Ffeed%2Ftopic%2F18+%28Computerworld+Applications+News%29

I wish everybody happy holidays and an amazing new year with lots of insights, success and vision.

Take Care!

Monday, December 19, 2011

Microsoft Dynamics AX 2012 White Papers: Code Upgrade

Hi!

The following link will allow you to download a series of white papers that are related to Microsoft Dynamics AX 2012 code upgrade, among other stuff.

http://www.microsoft.com/download/en/details.aspx?id=20864

In summary, the white papers cover the following:
Code Upgrade Overview - Discusses changes in the code upgrade for Microsoft Dynamics AX 2012.

Date Effective Patterns - Describes how to use date effective tables to store and track object history in Microsoft Dynamics AX 2012.

Implementing and Extending the Organization Model - Discusses the organization model in Microsoft Dynamics AX 2012, and provides guidelines for extending the organization model for new types of operating units that are required to support industry vertical scenarios.

Developing with Table Inheritance - Outlines the developer experience of creating and programming with the table inheritance data model in Microsoft Dynamics AX 2012.

Eventing - Describes the concept of events and how they can be used in Microsoft Dynamics AX.

Migrating Extended Data Type Relations - Describes how developers can migrate EDT relations to table relations in the Application Object Tree (AOT) in Microsoft Dynamics AX 2012.

Implementing the Global Address Book Framework - Describes the address book framework in Microsoft Dynamics AX 2012, which allows information to be shared across Microsoft Dynamics AX companies and entities through a central repository of users and organizations. It has been enhanced to facilitate easier sharing.

Implementing the Account and Financial Dimensions Framework - Highlights new patterns used to represent accounts and financial dimensions and describes how to convert the existing patterns to the new Microsoft Dynamics AX 2012 patterns.

Implementing the Budget Control Framework - Includes information about key integration patterns for new financial frameworks, how to make budget requests, and how to use the ledger budget control framework with core integration patterns.

Mapping the LedgerTrans Table to General Journal Tables - Describes how the LedgerTrans table has been mapped to multiple general journal tables.


Implementing the Item-Product Data Management Framework - Highlights the new patterns that are used to represent item-product master data. When detailing the new patterns, the document also describes the pattern that is being replaced and how developers should approach updating their code.

I have been able to go through a few of them and there is a lot of work to be done to get savvy in AX 2012.

I would suggest having a virtual machine with AX 2012 before even considering going over these white papers, believe me, I started looking at them without having an open instance of AX 2012 in front of me, and many stuff did not make any sense (i.e. Table inheritance development).

I hope you guys can share what you are discovering with the community at some point.

Take care!

OLTP vs OLAP - Definition and Differences

We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general we can assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help to analyze it.




In Microsoft Dynamics AX 2012 database we can find an OLTP database, which stores the AX data and the AX Model store, and the SSAS database used for SSRS reporting. At the same time, the Microsoft SQL Server Analysis Services uses an on-line analytical processing (OLAP) engine that helps users analyze business data and identify trends.

In this post I would like to describe what OLTP and OLAP is, differences, and provide a day-to-day example about the two.

OLTP (On-line Transaction Processing) deals with operational data, which is data involved in the operation of a particular system and it is characterized by a large number of short on-line transactions (INSERT, UPDATE, and DELETE).

The main emphasis for OLTP systems is put on very fast query processing, maintaining data integrity in multi-access environments and an effectiveness measured by number of transactions per second.

In addition, in an OLTP system, the data is frequently updated and queried and to prevent data redundancy and to prevent update anomalies the database tables are normalized, which makes the write operation in the database tables more efficient.

Example: In a banking System, you withdraw amount through an ATM. Then account Number, ATM PIN Number, Amount you are withdrawing and Balance amount in account are operational data elements.

An OLAP (On-line Analytical Processing) deal with Historical Data or Archival Data, and it is characterized by relatively low volume of transactions.  In addition, the Queries needed for these systems are often very complex and involve aggregations as for OLAP systems the response time is an effectiveness measure.

Example: If we collect last 10 years data about flight reservation, the data can give us much meaningful information such as the trends in reservation. This may give useful information like peak time of travel, and what kinds of people are traveling in the various classes available (Economy/Business).

The following table summarizes the major differences between OLTP and OLAP system design.


OLTP System
OLAP System
Source of data
Operational data; OLTPs are the original source of the data.
Consolidation data; OLAP data comes from the various OLTP Databases
Purpose of data
To control and run fundamental business tasks
To help with planning, problem solving, and decision support
What the data
Reveals a snapshot of ongoing business processes
Multi-dimensional views of various kinds of business activities
Inserts and Updates
Short and fast inserts and updates initiated by end users
Periodic long-running batch jobs refresh the data
Queries
Relatively standardized and simple queries Returning relatively few records
Often complex queries involving aggregations
Processing Speed
Typically very fast
Depends on the amount of data involved; batch data refreshes and complex queries may take many hours; query speed can be improved by creating indexes
Space Requirements
Can be relatively small if historical data is archived
Larger due to the existence of aggregation structures and history data; requires more indexes than OLTP
Database Design
Highly normalized with many tables
Typically de-normalized with fewer tables; use of star and/or snowflake schemas
Backup and Recovery
Backup religiously; operational data is critical to run the business, data loss is likely to entail significant monetary loss and legal liability
Instead of regular backups, some environments may consider simply reloading the OLTP data as a recovery method

Saturday, December 17, 2011

Changes in Reporting tools and Enterprise Portal in AX 2012

Hi there!
Well, I would assume that we are all excited about the new changes around the Reporting and Enterprise Portal tools in Microsoft Dynamics AX 2012, right?

Well, we should be, as Microsoft Dynamics AX 2012 has truly eliminated the need of having to install two different pieces of software to support reporting and EP development.  Currently, in AX 2009 the Reporting and EP tools are required components that we “have” to install in order to integrate AX 2009 and Visual Studio 2008.

 In AX 2012, however, standard Microsoft Visual Studio 2012 tolls can be used to achieve this Reporting and EP Development.  

In AX 2012 most of the basic development and some customization tasks (like creating new pages or adding Web parts to existing pages are all performed directly in SharePoint) related to the Enterprise Portal can be performed using SharePoint Foundation 2010 or SharePoint Server 2010. In addition, AX 2012 allows us to focus on the development of content Web parts in the Enterprise Portal by only using the Enterprise Portal framework and Visual Studio.  In fact, the most sophisticated functionality of Enterprise Portal is created by using Visual Studio.

Personally, I believe, the fact that EP proxies were taken out of the equation is a great step, as this created endless issues when updating EP proxies between AX 2009 and Visual Studio 2008. In fact, it was a suitable nightmare!

Reporting is not that bad in AX 2009, but the fact that we needed to install a piece of software to make it work really bothered me. Instead, AX 2012 provides a model-based approach to develop any type of report. It also provides templates and modeling tools that are part of Visual Studio.  Further, the reporting features provided by AX 2012 are really well integrated with SQL Server Reporting Services, which includes a set of tools for us to define reports in the Visual Studio.

I believe in simplicity, and the less we need to worry about installing several pieces of software to only make “one thing” work, the better.


Take care!

Friday, December 9, 2011

Intelligent Data Management Framework (IDMF)

Hi there,
There has been a lot of talk about the Intelligent Data Management Framework (IDMF) in AX 2012, and for a good reason!  This is because the Intelligent Data Management Framework allows the system administrators optimize the performance of Microsoft Dynamics AX installations, which is something that we all should be concerned about when implementing AX 2012.

Why? Well, first of all, the system requirements for AX 2012 are going to be much more than the ones for AX 2009.

This has been proved by a recent installation in Bank of America where they thought the hardware required was much more of what is needed for AX 2009. For this reason, the IDMF assesses the health of the Microsoft Dynamics AX application, analyzes current usage patterns, and helps reduce database size.  In addition, the IDMF lets you analyze the database and maintain an optimal database size by providing the purge and archive functions.

A Microsoft articles says “the purge function removes or deletes data from a set of related entities, or tables, from the production database. The archive function moves data from all related tables from the production database to a standby database called the archive database. Users can use the archive database for reporting purposes but cannot update it”

Further, both the purge and archive operations depend on a hierarchical relationship tree of related tables based on the Microsoft Dynamics AX metadata, and to create a hierarchical relationship, you select a parent table and discover all related tables based on the AX metadata.  
Moreover, the parent table in the relationship is put at the root level of the tree and the discovery process creates a nested relationship tree from a parent entity to a child entity. This is done until there are no relationships left at the lowest level.

Also, a purge object is used to remove selected records from all tables in the relationship tree from the AX database. Similarly, an archive object is used to move selected records from all tables in the relationship tree from the AX database to the archive database.

After creating a purge object or an archive object, you can apply business rules and selection criteria to entities and transactions to determine which records are deleted or moved from the production database.

System architecture

The IDMF was created using the Microsoft .NET development environment and provides a single document interface (SDI). In addition, the IDMF uses a database, called the management database, for the storage and retrieval of data, and communicates with Application Object Server (AOS) through COM Business Connector or .NET Business Connector.

Now, just be aware that during installation, the IDMF installs a Windows service called the Intelligent Data Management Framework for Microsoft Dynamics AX service. This service is used to run scheduled jobs and is referred to as the scheduler service for the Data Management Framework.

The following diagram provides a high-level overview of the Data Management Framework system architecture.




Deployment scenarios


Single-server deployment



Multi-server deployment



Distributed deployment


Take care!

Thursday, November 17, 2011

Naming Conventions in Microsoft Dynamics AX

Hi there!

I remember when I started developing software ... oh man, time goes fast as it was many years ago. In my first job I had a manager that would always reminded me to create clear naming conventions for my objects. He believed this was the base for any software development design as they were really important when scaling up an existing application. Yes, he was right!

Later in my life I started working in bigger teams, and one of the things that caught my attention in these environments was the fact that there were many developers that didn't care about creating consistent naming conventions when writing code.

Yes, this is horrible and makes it hard for the person who is later maintaining or scaling up the system.

There is a great quote about this:

“ Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. ” - Rick Osborne 


Luckily we don't have to work under the pressure that a psychopath will come to our homes at night if we don't write good naming conventions...But, what about the customer and/or employer who trusts us in doing a professional job?

To be honest with you, I think that dealing with a psychopath is much easier than dealing with an unhappy customer ... They support our lifestyle!

When I started working with Microsoft Dynamics AX, I rapidly understood the importance of getting into the habit of writing well defined naming conventions as the application objects are not only data types and classes (in the case of early languages), but tables, enums, macros, forms, data sets, queries, menu items, services, etc.

In addition, naming conventions contribute to consistency and to making the application easier to understand. I think that the basic rule to create good naming conventions is to do it from three basic components:
{business area name} + {business area description} + {action performed (for classes) or type of contents (for tables)}
Examples:
• CustJournalPrintOutInvoice
• PriceDiscAdmDelete
• PriceDiscAdmSearch
• PriceDiscAdmName
• PriceDiscAdmTrans

Also, take into consideration the following:
• All names must be in U.S. English.
• The default rule is to use logical and descriptive names if no other specialized rules apply.
• Identifier names have a limit of 40 characters.
• Names must be spelled correctly.
• Names must be used consistently.
• All texts that appear in the user interface must be defined by using a label.
• Do not begin a name with nonsensical or confusing prefixes, such as "aaa" or "CopyOf".
• Do not begin a name with "DEL_" unless it is a table, extended data type or enum, and it is needed for data upgrade purposes - doing this may cause unexpected results.

As you can see, by following these simple rules, we can start making a big difference in our code. Let's get into the habit ... otherwise the psychopath will get you!

Take care!

Wednesday, November 16, 2011

Configuring and running the AX 2012 Hyper-V image with VirtualBox

Hi!

A while ago I started setting up the AX 2012 virtual box in my laptop. It took me a few days to download and have everything ready to start setting the machine up. However, when I finally found the time to install it, I got a few errors on virtual PC . As a result I was unable to boot the machine successfully due to a file corruption error.

The following is a link that helped me out in fixing a few issues.

http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/a0565fd0-f978-4dbc-955b-45e0818440d8/


A few days later I found a video (below) that explained on how to install AX 2012 Hyper-V using the Oracle VM. After following the video (really easy to understand) I was able to successfully run AX 2012 VM on my computer.

NOTE: You will need access to partner source to download the AX 2012 VM files.

Check it out



Take care!

Inside Microsoft Dynamics AX 2012 Performance

Hi there!
I found a very interesting video on AX 2012 performance. It is amazing and really exciting to be part of this release as there have been many improvements to create a better, more reliable and faster product. The following are the key points in the video:
1-   Ax 2012 focuses its efforts on the AOS, this is, the AOS can scale up and scale out.  For example, as computer manufactures create bigger boxes (strong processing power), AX 2012 application server scales out to take full advantage of this new advances.
2-    Ax 2012 takes the unmanaged X++ and run it in .NET. Therefore X++ is now a managed language which means is faster (way faster than before!)
3-    There has been a lot of work done towards space optimization. For instance, in retail situations the number of transactions can quickly grow, and this data needs to be stored efficiently without increasing storage costs.
4-    Transactions are much faster thanks to the improvements in X++ compatibility with .NET. For example, in AX 2009 you could run 100 lines of code in X amount of time (X being a number of seconds). In AX 2012 you can run 1,000 lines of code in the amount of time (X) that AX 2009 does.  This helps achieving fast deployments and customer usability of the product.
5-    The goal of AX 2012 is increase transaction speed and customer satisfaction by implementing the solution on pretty much the same hardware an end user had before.
Check it out.

Take care!

Thursday, November 10, 2011

Debug X++ code in a Batch Server in AX 2009

Hi there!

Today I would like to discuss how to debug X++ code in a batch server. One of the common scenarios in AX development is the debugging of X++ code in the client.

For example, if you want to debug the SalesFormLetter class after posting either a Packing Slip or an Invoice, you just would go to the AOT > Classes>SalesFormLetter look for the method you want to debug and add a breakpoint. Simple!

In AX 2009, however, we have the ability to run Batch jobs directly on the server (unlike prior versions (i.e. 3.5)). The problem is that to accomplish this, we have to configure a few things.

The following are the steps to accomplish debugging X++ code in a batch server. The example is going to be using the SalesFormLetter class run method.

NOTE: Please use a Development or Test environment to try these steps.

1- Open the Client Configuration Utility and Click the Manage button. Choose Create New Configuration.

2- Give it a name. (I have chose Debug2713)



3- Set the server name, instance name and port (the default for the first instance of AX will be 2712. If you have more than one instance make sure you have the right port. In my case the AX second instance is 2713)



4- Go to the developer tab and check the both "Enable user breakpoints to debug in the business connector" and "Enable global breakpoints to debug code running in the business connector or client" check boxes.



5- Now open the Server Configuration File and Click the Manage button. Choose Create New Configuration. Give it a name (i.e. Debug)

6- Set the application file location and the alternate bin directory and the Application instance. In addition, check both the "Enable breakpoints to debug X++ code running on this server" and "Enable global breakpoints to debug X++ code running in batch jobs" check boxes.



7- Click the Database Connection tab and set both the server name and database name.





8- Open the AR module and go to Periodic > Clean Up > Sales update history clean up

9- Choose the Executed Clean Up option and a date and click OK.



10- Open the AOT, go to Classes and look for the SalesFormLetter class. Open the class and look for the Run method and place a breakpoint anywhere in the code.



12- Open the AX 2009 debugger



12 - Go to AR > Common Forms and open the Sales Order Details form. Choose an Open Order and click the Post button. Choose Packing Slip (i.e.)

13 - The SalesEditForm will open. Click the Batch button and set the batch.



14- After clicking the OK button you should see the following message




If you want to check the status of your batch you can go to Basic > Inquiries >Batch Job. Your scheduled job should be in there. Wait a few minutes and the debugger should open at the breakpoint you inserted before.


NOTE: Sometimes you will have to restart the AOS service when the debugger does not open and your job has already executed. In addition, you MUST have a batch group setup.

Take Care!

Monday, November 7, 2011

Get the active comapny in AX 2009 - curExt()

Use the curExt() function to get the active company in AX;

static void curExtExample(Args _arg)
{
str CompanyId;
;

CompanyId = curExt();
Info(CompanyId);
}

You would also use the following with the same results. However, the above is much more elegant.

static void curExtExample(Args _arg)
{
str CompanyId;
;

CompanyId = CompanyInfo::Find().DataAreaId;
Info(CompanyId);
}

Take Care!

Friday, November 4, 2011

Microsoft Dynamics AX 2012 White Paper: Selecting the Best Development Technology for Your Application Development Scenario

Microsoft Dynamics AX 2012 provides developers with new choices for programming models and developer technologies.

The following link discusses the following topics:

  • Development patterns in Microsoft Dynamics AX 2012
  • Programming models available in Microsoft Dynamics AX 2012
  • Changes to the core development framework in Microsoft Dynamics AX 2012
  • Selecting the appropriate programming model for your development patterns
  • The Microsoft Dynamics AX development technologies road map

Here is the link!

http://www.microsoft.com/download/en/details.aspx?id=24322

Wednesday, November 2, 2011

Indexes In Microsoft Dynamics AX

Today I would like to have a discussion about Indexes in AX. In my opinion, I think it is extremely important to create an architecture that will support the fast retrieving of records. In addition, there is no way we can provide a good service if we don’t provide a nice and easy to follow guide on indexes.  

So, basically indexes in databases are used to locate records and they are stored separately in the database. They contain a key that can be quickly located in the index, and this key will have a reference to a record.

For example, the let’s think on the SalesIdx index in the Sales Table. This table field index contains the SalesId of a Sales Order. Now, because the Sales order is unique and sequenced, an index will be used to quickly lookup the sales orders records through the reference.

Type of Indexes

Unique

A unique index is created based on a column; Microsoft Dynamics AX assures that no duplicate key values can occur in that same column. Also, when updating a column that contains a unique index will cause an error.


Non-Unique

Non-unique indexes are created for performance reasons. In other words, they give a fast way of retrieving data. For example, (and here we can think on the example above about the SalesIdx) instead of doing a full-table search of all the records in a table, and non-unique index will help us narrow down this search to a reference.

In general, indexes use system space and must be updated every time system data is created, edited, or deleted. I have seen indexes slowing down the updating process. However in most cases the overall performance improvement when selecting records far outweighs the performance loss when updating.

Microsoft recommends that when creating an index to give it a name that reflects the names of the fields on a table plus the suffix Idx. (i.e. SalesIdx)

Creating Indexes

Creating indexes is not very difficult at all. You just want to make sure that the fields you want to create the index on exist in the table (I guess this is obvious, but you’ll be surprise with some of the question I have been asked over the years). Anyway, the indexes can be unique or non-unique, and are based on a single column or multiple columns that exist within the table.



  1. Locate a table in the AOT (This has to be a table in your Dev environment or some virtual machine AX)
  2. Right-click the Indexes node in the table and select New Index. A new index Index1 is created.
  3. Rename the index to the field name of the table/field you have chosen
  4. Drag the field you have chosen to the index created in the step above node.
  5. In the properties sheet for the created index node, set the property AllowDuplicates to No.

Just to make it more visually clear, please take a look at the following picture:


Take Care!