Monday, August 04, 2014

Maps in AOT (Microsoft Dynamics AX 2012)

Microsoft Dynamics AX 2012 :Maps in AOT

Maps are nothing just an element/object the makes possible to link/associate map fields with fields(same type with different names) in different tables like, I have create a MAP with field (AccountNum) and Same field exist in CustTable and also in VendTable,so I can associate field in CustTable and in VendTable with Maps, so basically  Maps enables to access the fields with different name in different tables.

EXAMPLE:
I have created a Map by navigating to AOT>Data Dictionary>Maps and right click and new and gave it name ‘MapTest’


I have created 4 fields in under Fields node in Map (drag and drop from EDT)


Now the next thing I need to do is to associate the fields in map with the fields in different tables, let say I am taking two tables (CustTable and VendTable).


Notice that above, four fields that I have created in Maps also exist in CustTable as well as VendTable with different names.
To associate fields, go to Mapping node, right click it and click New mapping, and enter the table that you want to associate in Mapping Table field. Like


And the associate fields with fields in MAP


Now I have created a method called printInfo under method node in Maps, which print the value of the map field AccNumber.

public void printInfo()
{
info(strFmt(“Map : AccountNum :%1″,this.AccNumber));
}

Similiarly I have create same methods under method nodes of CustTable and VendTable which are printing their respective AccountNumber fields


Now finally I have created a job see below I  am not describing every line as I have added comments above the line.


When I run this job see what happens


Happy DAXing......... :)




Friday, August 01, 2014

How to write methods on the list page Form in Ax 2012

How to write methods on the list page Form in Ax 2012


Scenario: I have a menu item that calls some class to do manipulation on the list page Form and I need to refresh the list page now. List pages do not allow writing of code on the Form, as they used interaction class.
Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto. However after this change, you won’t be able to use this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However if you want to use it only in rich client then you are good to do this.
Any ways override the clicked method and call research() of the data source to do this

Happy DAXing.... :)

Thursday, August 08, 2013

TFS integration with Microsoft Dynamics AX 2012 and automated scripts for build and deployment

Hello Friends,

For TFS integration,we have come up with a white paper which details what setup is required for using TFS with AX 2012. The white paper is available on information source -

Change management and TFS integration for multi developer projects

It details steps related to creating and deploying Microsoft Dynamics AX builds on computers connected to a central Microsoft Visual Studio Team Foundation Server (TFS) source control system. The document covers two topologies used by Microsoft Dynamics AX developers: private and shared Application Object Server (AOS) topologies.

Once TFS is setup , it is important to have automated build and deployment process. For this , we have provided powershell scripts.

Build and deploy scripts for Microsoft Dynamics AX 2012

The scripts provide automation for creation and deployment of builds for Microsoft Dynamics AX 2012. The scripts can be used with TFS providing end to end solution for build and deployment. The script performs tasks like sync, creation of TFS label, combining multiple source XPOs to single XPO, validating if build is healthy, etc. These scripts can also work with non-TFS version control where it provides all functionality except the one related to TFS.

Following scenarios are covered -

1. Creating a build – A Microsoft Dynamics AX build is created from specific versions of source files (XPO files, Visual Studio projects, and label files) in the TFS central repository. Source files that share a common label constitute a specific build of a Microsoft Dynamics AX model or application. Output of a build would be model file(s).

2. Deploying a build – Developer(s) should be able to deploy model file(s) (generated from build process or manually) in Ax installation(s). These scripts require some configuration files and parameters which are explained in detail in the above white paper.

Happy DAXing........ :)

Source : MSDN Blog by Mudit Mittal

Friday, July 05, 2013

How to Add summary fields of the FastTab in AX2012?

Hello Friends,

To add a field value to the summary fields of the FastTab, you use the FastTabSummary property of the control.

Note: The FastTabSummary property does not appear on all controls. For example, the reference group control does not include the FastTabSummary property.

To specify whether a field value appears in the summary fields, click the control that has the value that you want to display in the summary and then click one of the following values.

FastTabSummary
Description
Auto
The default value. The field value is added to the summary fields for the first five fields that are members of the AutoSummary field group of the table.
No
The field value does not appear in summary fields of the FastTab.
Yes
Adds the value that appears in the control to the summary fields of the FastTab.


Happy DAXing….. J

Tuesday, May 07, 2013

Data Migration Framework (DMF) AX 2012


Hello Friends,

The Data Migration Framework for Microsoft Dynamics AX 2012 is an extension that helps you migrate data into Microsoft Dynamics AX. Examples of the data that you can migrate include master data, open stock, and balances.

The Data Migration Framework is available from the InformationSource services download page.

The Beta 2 version of the Data Migration Framework includes support for the following new features:

  • ODBC connections as a data source.
  • Microsoft Dynamics AX databases as a data source. You can now export and import Microsoft Dynamics AX, and copy company information by using Data Migration Framework entities.
  • Direct table and composite entity types.  
    • A direct table entity enables you to migrate data from a source to a target Microsoft Dynamics AX table directly, without going through a staging table or applying any business logic.Unlike other entities, data cannot be pushed from one source table to multiple target tables. The direct table entity must be a one to one mapping from source to target.
    • A composite entity groups multiple related entities together. An example of a composite entity is a Sales Order and Sales Line entities combined together.
    • Parallel execution of threads to move data from staging to target tables.
  • Using the Data Migration Framework as a service. The framework can now be executed by external applications.
  • Error-handling enhancements. The Data Migration Framework provides more detailed logs, and can skip rows that contain errors.
  • Number sequence support.
  • Remote installations of Microsoft SQL Server Integration Services. It is no longer necessary to install Integration Services on the same computer as the Application Object Server (AOS).

Please visit following links for more information.


Happy DAXing..........

Friday, May 03, 2013

How to Print welcome message on Start-up of AX 2012 Client ?


Hello Friends,

Today I will demonstrate you that How to Print welcome message on AX rich & development client startup. Follow below steps when you want to execute some business logic in AX Startup.

  • Open AOT
  • Go to Classes -> Info
  • Open the StartupPost() method
  • Type following Code there


void startupPost()
{
     //your code goes here
    box::info("Welcome to Dynamics AX 2012 world!!!!");
}

Happy DAXing……. J



Thursday, May 02, 2013

Regular Expression in AX 2012


How to use the regular expression to validate the number string

static void TextBuffer_RegularExpression(Args _args)
{
    TextBuffer txt = new TextBuffer();
    str msg = "9876543210";

    txt.setText(msg);

    // activate regular expr in search
    txt.regularExpressions(true);

    // Regular expression to validate only digits
    if (txt.find("^[0-9]+$"))
    {
        info("string contains only numbers");
    }
    else
    {
        info("string contains Alphanumeric characters.");
    }
}

Happy DAXing...... :)

How to stop updating existing records while importing Data through Data Management Framework (DMF)

Problem Statement : I was working on a requirement involving file-based integration using the Data Management Framework (DMF). The data ent...