RSS

Monthly Archives: March 2014

Setup AX 2012 R3 Source Control with TFS online

It is working like a charm. Remember that I’m setting this up with AX 2012 R3. I’m sure there are some issues with AX 2012 (AX 2012 is only supported for TFS 2012 and 2012) and AX 2012 R2. We need  TFS 2012 client compatibility.

Notes:

  • Version control system (VCS) is a small part of Application Lifecycle Management (ALM)  which uses Team Foundation Server (TFS) as recommended toolset.
  • Visual Studio Online is a cloud based service. It was released in November 2013 and is free of charge for up to 5 users. Therefore it is the perfect first step to get in touch with the power of TFS Integration with Dynamics AX. There is nothing stopping you from testing the capabilities of this integration for your Dynamics AX 2012 development.

Let’s get started

Step 1:  VS Signup

Sign up with www.visualstudio.com. You are going get an account like YOURACCOUNT.visualstudio.com

Step 2: Setup a new project

image

image

Step 3: Version Control Parameters

Go to AX Development Workspace > Tools > Version Control > Version Control Parameters

image

Step 4: Parameters version control Setup

image

Step 5: Team Foundation Server Setup

image

Team Foundation Server URL: YOURACCOUNT.visualstudio.com
Team Foundation Project name: Project you created in “STEP 2”
Branch folder: Give it any name
Application root folder: A physical folder name in your repository folder that you setup at STEP 4

 
Current Directory Structure

image

You might be prompted for a log in

image

image

Step 6: Synchronize

This process can be lengthy, depending on the number of objects it has. TFS will download all files to local repository

image

Remember to check “Force”  to download all the object from the VCS (Version Control System)

image

The process will put all the objects in a model.

 image

You are now ready for development !!!

Snapshot of folder structures

Checking in a file

image

File on TFS server

image

File on local machine

image

Advertisements
 

Tags: , , , ,

Effective way to resolve all weird issues caused by users’ cache

I found these steps below are very effective to clear up weird issues after code/data migration or when users start experiencing wacky behaviors

STEP 1: Run the job below

public server static void FlushAll(Args _args)
{
   Args args;
  
   // Leave the "args" as null will skip the info messages normally shown when using menu items.
   SysFlushAOD::main(args);
   SysFlushData::main(args);
   SysFlushDictionary::main(args);

}

STEP 2: Delete user cache

Method 1:

  1. STOP AOS
  2. Log on to TS where all users use to connect to AX
  3. Search of *.AUC files and delete all these files
  4. Restart AOS

Method 2:

  1. Run this job on TS where all users use to connect to AX.
static void ClearAucFileForUsers(Args _args)
{
    System.Array    files;
    int             fileCount;
    int             i;
    str             nextFile;
    str             path = "C:\\Users";
    str             Finalpath;
    str             pattern = "*.auc";
    container       listOfFiles;
    int             DirCount;
   
   
    System.Array    Directories;
    int             j;
    str             nextDir;
    container       listOfDir;
   
    FileIOPermission    dirPermission, filePermission;
    InteropPermission   interopPermission;
    Set                 permissionSet;
   
    new InteropPermission(InteropKind::ClrInterop).assert();
    listOfDir = conNull();
    listOfFiles     = connull();
   
    Directories = System.IO.Directory::GetDirectories(path);
    if(Directories)
    {
        DirCount = Directories.get_Length();
       
        for(j=0; j < DirCount; j++)
        {
            nextDir    = Directories.GetValue(j);
            Finalpath = nextDir + "\\AppData\\Local";
            listOfDir += Finalpath;
        }       
    }
    j=0;
    DirCount = conLen(listOfDir);
    while( j < conLen(listOfDir))
    {
        j++;
        Finalpath = conPeek(listOfDir,j);
        try           
        {
            files           = System.IO.Directory::GetFiles(Finalpath, pattern);
        }
        catch
        {
            continue;   
        }
        if (files)
        {
            fileCount =    files.get_Length();
           
            for(i=0; i < fileCount; i++)
            {
                nextFile    = files.GetValue(i);
                System.IO.File::Delete(nextFile);       
                info(nextFile);
            }
        }
    }
   
    CodeAccessPermission::revertAssert();
}
  1. Stop and Restart AOS

STEP 3: Delete SysLastValue

static void DeleteAllLastValue(Args _args)
{
    SysLastValue syslastValue;   
   
     ttsBegin;
     delete_from syslastValue;
     ttsCommit;   
}
 
 

Tags: , , , , ,

Microsoft Dynamics AX 2012 R3 Training

In this series you will learn about how to get started with Microsoft Dynamics AX 2012 R3. You will see courses that focus on specific areas of functionality, and how to run your business processes using AX 2012 R3. Two current available topics are

  • Transportation Management

  • Warehouse Management

image

 
Leave a comment

Posted by on March 25, 2014 in Development, Video

 

Tags: , , , , ,

Reporting architecture

 

Reporting architecture

  1. A user requests a report.A menu item in the Microsoft Dynamics AX client may be bound to a report for Reporting Services. After a user clicks the menu item, a parameters form is displayed to the user. The user enters parameters to filter the data that is displayed on the report.

    The Microsoft Dynamics AX client then requests the report from an instance of Reporting Services. The request includes the parameters that the user entered.

  2. Reporting Services receives the request and requests the report data from the Microsoft Dynamics AX server.Reporting Services receives the request and examines the report. The report is stored as an .rdl file. The .rdl file indicates the report’s data source. The data source may be a Microsoft Dynamics AX query, a report data provider class, or an external data source that is accessed through report data methods.

    If a Microsoft Dynamics AX data source is used for the report, Reporting Services uses the Microsoft Dynamics AX data extension to retrieve the data.

    Reporting Services then requests metadata about the data source from Microsoft Dynamics AX. Then Reporting Services requests the data for the report.

  3. The Microsoft Dynamics AX server receives the request and sends the report data back to Reporting Services.The Microsoft Dynamics AX services examine the query in the Application Object Tree (AOT) to return the requested metadata. The services also run the query to generate the data for the report.

    Microsoft Dynamics AX then returns the metadata and data to Reporting Services.

    Note:
    Microsoft Dynamics AX enforces security on all data that it returns. If the user who is running the report is not allowed to see a specific field, the data for that field is not returned.

  4. Reporting Services renders the report and sends it to the Microsoft Dynamics AX client.The Microsoft Dynamics AX customization extension formats the report. The customization extension uses metadata to provide automatic formatting of data and can affect the positioning and layout of elements on the report.

    Reporting Services then renders the report into a visual representation and sends that representation to the Microsoft Dynamics AX client.

  5. The report is displayed to the user.The Microsoft Dynamics AX client displays the report to the user in the report viewer control.

References:

http://technet.microsoft.com/en-us/library/dd361996.aspx

 
1 Comment

Posted by on March 25, 2014 in Development

 

How to update/edit customer addresses with additional address purposes?

Requirements:  Needs to update all customer addresses with a delivery purpose to also have an invoice purpose.

image

image

Solution:
This job below will update every customer’s address which has purpose Delivery with additional Invoice purpose. We can extent this to update/edit vendor address as well.

static void updateCustomerPostalAddresses(Args _args)
{
    #define.Delivery("Delivery")
    CustTable custTable;
    DirPartyPostalAddressView   addressView;
    LogisticsPostalAddress      postalAddress;
    DirPartyLocationEntity      partyLocationEntity;
    container purposes;
    int counter;
    
    ttsBegin;
    setPrefix("Update Customer addresses:");
    // Iterate every customer    
    while select * from custTable        
    {
        setPrefix(strFmt("Customer: %1", custTable.AccountNum));
        {
            // Iterate every addresses every customer has
            while select addressView
                where addressView.Party == custTable.Party
            {
                if(strScan(addressView.locationRoles(), #Delivery, 1, strLen(addressView.locationRoles())))
                {
                    if (DirPartyLocation::findByPartyLocation(addressView.Party, addressView.Location))
                    {
                        postalAddress = LogisticsPostalAddress::findByLocation(addressView.Location, true);
                        if (postalAddress.RecId > 0)
                        {
                            partyLocationEntity = DirPartyLocationEntity::construct(addressView.Party);
                            partyLocationEntity.parmLocation(postalAddress.Location);
                        
                            purposes = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Invoice).RecId];
                                                
                            // Create party links
                            partyLocationEntity.createPartyLocationAssociation(purposes, addressView.IsPrimary, addressView.IsPrivate);
                            info(strFmt("Update address: %1",  addressView.Address));
                            counter++;
                        }
                    }                
                }
            }
        }            
    }
    
    info(strFmt("Total address(es) updated: %1", counter));
    ttsCommit;
}

Result:

image

image

 
Leave a comment

Posted by on March 25, 2014 in Development

 

Tags: , , ,

DIXF – Errors after upgrading to CU7

After upgrading to CU7, DIXF does not work anymore and it gives a bunch of errors like below

“Cannot create a record in XML to entity mapping for a definition group (DMFSourceXMLToEntityMap). Processing group: Vendor, Vendor. The record already exists.”

image

“Cannot create a record in XML to entity mapping for a definition group (DMFTargetXML). Processing group: Vendor, Vendor. The record already exists.”

image

“Cannot create a record in Staging log (DMFStagingLog). Stage: Source.
The record already exists.”
image

Solution:

The code that creates the standard entities was trying to create with an existing recid violating the index.  By deleting the data out of these tables will solve this type of problem

DMFSourceXMLToEntityMap
DMFTargetXML
DMFTargetXMLToEntityMap
DMFEntity
DMFStagingLog

 
1 Comment

Posted by on March 13, 2014 in Installation and Configuration

 

Tags: , , , , ,

Dynamics AX Build numbers

The build version numbers are split into three parts. First the client version number is listed, followed by the application version. Formatted like: Build #client version/application version/localization versions.

Dynamics AX 2012 R3

Build number Version
6.3.126.8 2012 R3 CTP5
6.3.42.13 2012 R3 CTP4

Dynamics AX 2012 R2

Build number Version
6.2.158.0 2012 R2
6.2.1000.156 2012 R2 Cumulative Update 1 (CU1)
6.2.1000.1437 2012 R2 Cumulative Update 6 (CU6)
6.2.1000.4051 2012 R2 Cumulative Update 7 (CU7)

Dynamics AX 2012

Build number Version
6.0.852.78 2012 Beta
6.0.947.0 2012 RTM
6.0.947.61 2012 Cumulative Update 1 (CU1)
6.0.947.280 2012 Cumulative Update 2 (CU2)
6.0.947.862 2012 Feature Pack
6.0.1108.670 2012 Cumulative Update 3 (CU3)
6.0.1108.2423 2012 Cumulative Update 4 (CU4)
6.0.1108.4316 2012 Cumulative Update 5 (CU5)

 

 
Leave a comment

Posted by on March 12, 2014 in Development

 

Tags: , ,

 
%d bloggers like this: