Welcome to addressing common issues in Master Data Management (MDM) for Microsoft Dynamics AX 2012. This is the second article in our How to: Master Data Management series for AX 2012. If you missed the first article, How to Install and Configure Master Data Management for AX 2012, you can find it here.

Now we will walk you through troubleshooting the most common issues faced with AX 2012’s Master Data Management by providing experienced working solutions for these problems.

1. Only one record gets synchronized

Issue: When synchronizing a newly created entity for the first time, only one record gets synchronized.

Figure 6: Infolog message after one record synchronized

Solution: When solving this issue, first check how the data was moved to the staging table. You can start by reviewing the Processing group form, which can be executed by going to Data import export framework - Common - Processing group - Get staging data [button].

In doing this ourselves, this resulted with a different Infolog message, which specified some errors had occurred:

Figure 7: Infolog message after manually retrieving staging data

After opening the error log of the conflicting Processing group (select your Processing group, then press the Execution history button, and in the opened form select the newest execution, press Error log button), there appears to be an issue with duplicates in the staging table:

Figure 8: Staging error log form

The final discovery to resolve this issue is identifying the primary key that was missing from the staging table. By inputting the primary key you can eliminate creating duplicate records.

2. Stack trace error while validating staging data

Issue: Stack trace error received from trying to validate data for the Processing group Data import export framework - Common - Processing group à Execution history (button) - View staging data [button] - Validate all [button].

Infolog with stack trace error

Figure 9: Infolog with stack trace error

Solution: Start by checking your entity’s staging table validateField method and make sure it has the following code:

public boolean validateField(FieldId _fieldIdToCheck, boolean validate = false)

{

    if (!validate)

    {

        return true;

    }

    return super (_fieldIdToCheck);

}

 

A faulty validateField method error can occur when the code in your entity appears as such:

faulty validateField method

Figure 10: faulty validateField method

In this example, the system called this method using two parameters. However, the method only had one, hence “The method has been called with an invalid number of parameters” error was thrown. This faulty code was generated by the Custom entity wizard, which is used to create custom entities. Ensure you have the correct number of parameters defined to avoid this common error.

3. Inconsistent data

Issue: Newly created Master Data Management entity, for example new MDM entity for WHSPhysDimUOM table, doesn’t render value when the data was written to the target table correctly but when you open the product form, related values are empty.

Solution: In this case, the related fields in InventTable are empty because they are being filled in by WHSPhysDimUOM.insert() method. This method was skipped by the Master Data Management import because by default it calls WHSPhysDimUOM.doInsert(), which skips the insert() method. To solve this, you need to mark Run business logic in insert or update method checkbox in two places:

  1. Entity structure form which can be opened from Target entities

entity structure form

Figure 11: entity structure form

  1. Select entities for Processing group form, which can be opened by selecting your entity’s import Processing group from Processing group

Processing group form

Figure 12: Processing group form

Now <target table>.insert() and <target table>.update() methods will be run when synchronizing Master Data Management entity.

4. Long synchronization and an error

Issue: Synchronization takes longer than usual, then throws you an error.

The error appears as such:

SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.

An OLE DB record is available.  Source: "Microsoft OLE DB Provider for SQL Server"  Hresult: 0x80004005  Description: "The statement has been terminated.".

An OLE DB record is available.  Source: "Microsoft OLE DB Provider for SQL Server"…

Solution: There can be a few reasons:

  1. Lack of system resources;
  2. DIXF service is handling data from another synchronization session; or
  3. Synchronization has reached a timeout.

To handle those, you can try three solutions: (1) restarting AOS; (2) restarting DIXF services; or (3) increasing DIXF timeout.

To increase DIXF timeout open:

C:\Program Files\Microsoft Dynamics AX\60\DataImportExportFramework\ Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe.config file using file editor and add the following lines:

SSISHelperService.exe.config file

Figure 13: SSISHelperService.exe.config file

Change send / receive timeouts as needed.  Following these simple steps you should avoid the common issue of long synchronization times as well as associated errors.

5. Data doesn’t go through correctly for newly added field

Issue: Data for a field is not updated when you create a new field by adding it to the staging table.

Solution: This most likely is caused by forgetting to refresh your entity. You can refresh using these simple steps:

  1. Regenerate mapping for your entity;
    • Data import export framework - Setup - Target entities - Modify Target mapping [button] - Generate mapping [button];

Generate mapping button in staging to target mapping form

Figure 14: Generate mapping button in staging to target mapping form

  1. Make sure the new field is added to Master Data Services;
    • Data import export framework - Master data management - Publish entities to SQL Master Data Services - select your entity and push Compare entities [button] - Press Append schema [button] to add your field to Master Data Services.

Append schema button in Compare entities form

Figure 15: Append schema button in "Compare entities" form

  1. If the above steps didn’t resolve the issue, try to re-create the entity as described in Master Data Management Installation and Configuration associated article.

6. Not all records are synchronized from target table

Issue: Only a portion of all existing records are exported from target table.

Solution: This issue occurs when you have re-created and synchronized your entity several times.

When synchronizing data Master Data Services - AX, data is written to target table using a Master Data Management user, so the modifiedBy field for the synchronized record will have Master Data Management user value. For this reason you need to enable modifiedBy table property for *CTQuery datasources. When synchronizing data AX - Master Data Services only the records that are not modified by the Master Data Management user are exported in order not to have duplicate records in Master Data Services.

If you’re having this issue, try checking whether there are records with the Master Data Management user set as modifiedBy in your target table. If yes, you should reset this value to any other user.

Troubleshooting Master Data Management with Debugging

If you still are not able to find a solution to your problem in this blog post, try debugging the solution step-by-step. First try debugging using the AX debugger and with Execute business operations in CIL checkbox deselected:

Execute business operations in CIL parameter in user options form

Figure 16: Execute business operations in CIL parameter in user options form

If the code that you’re trying to debug is run on a server level and the breakpoint is not hit, try debugging using visual studio (more how to info here).

These are good places to start - areas in the code where you can put breakpoints and start debugging:

  • MdmSynchronizer [Class] / synchronize
    • This class is run when you push the New schedule button in Manage synchronization form in Data import export framework
    • This code is always run on the server, so you need to debug it using Visual Studio.
    • This method executes all the Master Data Management related cases such as writing data to staging table, moving data from AX to Master Data Services, moving data from Master Data Services to AX and writing data from staging to target. So it’s a good place to start debugging.
  • DmfEntityBase [Class] / copyTargetToStaging
    • When you have a problem on the AX - Master Data Services side, and you don’t have Visual Studio to use as a debugger, you can move data to the staging table using Processing groups: Data import export framework - Common - Processing group - Get staging data [button].

Tip: There may be instances when you want to force synchronization for all your entity records. In this case, there is one workaround that you can use – set AxSyncVersion field to -1 for your entity in MdmEntity table.

MDMEntity table with AxSyncVersion set to -1

Figure 17: MDMEntity table with AxSyncVersion set to -1

How To: Master Data Management Installation and Configuration

To learn more about installing and configuring Master Data Management in AX 2012 check out the other blog in our Master Data Managem ent series here