Monthly Archives: November 2012

DMF – DMF Service is unavailable

I got this message in the Beta 2 version of the Data Migration Framework in Dynamics AX 2012.

This link is an important piece of information that you will need to understand some of the errors you get while trying to set up some of the new functionality in BETA 2, such as ODBC connection as a source data format.

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

I got this message when I was trying to validate the connection string to an ODBC database. The reason for this was that the original installation had failed because of some unknown reason.

DMF Service is unavailable

It´s important to know that we, in this case, have the installation of the server integration services on the same server as the AOS.

In Beta 1 the installation resulted in one new folder under program files, in Beta 2 there should be three folders.

1. Microsoft Dynamics AX 2012 Data Migration Framework Server Components(Beta)
2. Microsoft Dynamics AX 2012 Data Migration Framework Client Components(Beta)
3. Microsoft Dynamics AX 2012 Data Migration Framework Service (Beta)

In our case the Service folder and it´s content was missing. Knowing this, the error message I got started to make a lot more sense.

This is how you test if your service is up and running. Log in to your AOS server and open a browser, then enter this URL in your web browser:

http://DMF-Service-ComputerName:7000/DMFService/DMFServiceHelper.svc

Of course you have to change the “DMF-Service-ComputerName” part to your server name first.

When we tried this, the service was not up and running. What we did was to turn of the AOS service and then run the installation process again for the service part of the DMF installation. After it was finished our “Microsoft Dynamics AX 2012 Data Migration Framework Service (Beta)” folder was where is should have been all along, under Program files.

We then started the AOS service and tried again. This time we could both access the service using the URL in a browser and validate the connection string to the database on the odbc source data format.

On to the next challenge.

DMF – Error occured while doing bulkcopy from temp table to entity table

This is a generic error message you get in data migration framework from time to time.

Error occured while doing bulkcopy from temp table to entity table

I have found that the reason for this could one of many. This is the ones I have encountered.

Continue reading DMF – Error occured while doing bulkcopy from temp table to entity table

DMF – Cannot create a record in Product number (EcoResProductIdentifier)

When working with the new Data migration framework module in Dynamics AX 2012 you will encounter a lot of problems and strange errors. One I recently encountered is this error message.

“Cannot create a record in Product number (EcoResProductIdentifier). The record already exists”

Continue reading DMF – Cannot create a record in Product number (EcoResProductIdentifier)

Date and UtcDateTime interval for previous month

This code calculates the first and last date of the previous month.

1
2
3
4
5
6
7
8
9
10
11
12
static void EP_dateMonthInterval(Args _args)
{
    date            fromDate;
    date            toDate;
    date            baseDate = systemDateGet();
    ;
 
    toDate      = dateStartMth(baseDate) - 1;
    fromDate    = dateStartMth(toDate);
 
    info(strFmt("%1 - %2", fromDate, toDate));
}

UtcDateTime version of the same job.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
static void EP_UtcdateMonthInterval(Args _args)
{
    UtcDateTime     fromDate;
    UtcDateTime     toDate;
    UtcDateTime     baseDate = DateTimeUtil::utcNow();
    ;
 
    // Remove this month number of days.
    toDate = DateTimeUtil::addDays(
    baseDate, -(DateTimeUtil::day(baseDate) -1));
 
    // Add the rest of this days time minus one second.
    toDate = DateTimeUtil::addSeconds(
    toDate, -(DateTimeUtil::time(toDate)+1));
 
    // Remove the number of days we are on in
    // the previous month and add one second to 
    // get to the first of the month.
    fromDate = DateTimeUtil::addSeconds(
    DateTimeUtil::addDays(
    toDate, -(DateTimeUtil::day(toDate))), 1);
 
    info(strFmt("%1 - %2", fromDate, toDate));
}