Sunday, July 5, 2015

Import Customers using Data Import framework | AX 2012 R3


This post illustrate how to import Customers basic information using the data import framework in Dynamics AX 2012 R3

1- Go to Data import export framework --> Setup --> Data import / export framework Parameters.

2- Click browse to select shared working directory then click Validate button then close the form.

3- Go to Data import export framework --> Setup --> Source Data format, Create new source name and make sure to chose File in the Type then Change the Column delimiter if needed.

4- Go to Data import export framework --> Common --> Processing Group, Create New Group then Click the Entities Button.

5- in the entities form select the Customer Entity, CSV in the Sources data format, then Click the generate source file button.

6- in the wizard make sure to select the following fields:
Accountnum (Customer Code)
Name (Customer Name)
CustGroup (Customer Group)
Currency (Customer Currency  ) 
CountryRegionID (Currency Region)
then click Generate sample file.

7-Save the file in the shared folder you specified in step 2.

8-Open the file using MS Excel, fill the data then save the file.

9-Go back to the processing group --> entities---> Select the Sample file path then click the generate source mapping button..

10- if the mapping done successfully Click the Preview source file button to preview the data then close the form.

11- in the processing group select the group name then click the Get staging data button to copy the file data to staging table.

12-Click OK to create job.

13-Click Run in the staging data execution form.

14-Click OK.

15-The records will be inserted in the staging.

16-In the processing group select the group name then click Copy Data to target button.

17-Select the Job ID that we created in step 12 then click OK.

18- Click Run to import the data

19- Click OK.

20-The data will be written to target.

20-Go to the Customers List form, note that customers records was imported successfully.

List of table in AX 2012 should be backuped while restoring the database

List of table in AX 2012 should be taken backup while restoring the database

Table Names:


















How to restore the DB Form Source to 

Destination in Microsoft Dynamics AX 2012 R3


Objective: Main Objective is to save the system tables/settings

Like EP, BI, SSRS, User Info and Etc…


Step 1: Open Source Environment Database via SSMS

Step 2: Create a Local folder to store the DB files

Step 3: Backup Source Environment Database

  • ·         Stop AOS (Backup can also be taken without stopping the AOS)
  • ·         Perform full database backup via SQL

Step 4: Backup Destination Environment Database

  • ·         Stop AOS (Backup can also be taken without stopping the AOS)
  • ·         Perform full database backup via SQL

Step 5: Backup System Configuration Tables in the destination environment


Select the database MicrosoftDynamicsAX

Select > Tasks > Export data



















Follow this:





Select the Server Name here in our case LocalServer


 Choose Destination Database (create new database) click New>



Type database name and click OK.

This database will contain the backup of the tables which are needed to be backed up for the destination environment.


Click OK>

Click Next>



Click Next>



Select all the tables needed> Use Page down Key from your keyboard.



Select all the system tables from the list below and then click Next>


Full list of system tables for AX2012 R3 (include or exclude user-related tables – marked as Optional – depending on whether you want to keep the user setup or not):





Click Next and Finish





Note: 11 Total may not be as per your need.


Step 6: Restore source database backup to the destination database

Database restore from a backup (WITH REPLACE)
Note: ensure data and log file names are correct.

Step 7: Import data from the new database created in Step 5



Select the database MicrosoftDynamicsAX and click Tasks > Import data



Select the Server Name as LocalServer.


Select System Parameter form the Database Drop down and click Next>








Choose destination (select destination environment database) and click Next>




Click Next>


Just Check the Database Name is correct or not.




Next>






Select the Tables from top> all will be selected automatically>


Select Edit Mappings> Check Delete option> Click Ok.




Click Next> Next> Finish!

Click Close

Step 8: Start and synchronise

·         Start the AOS

·         Open the AOT Synchronise dictionary in the destination environment.


Happy DAX Infra!

Monday, June 8, 2015

Fix some errors from: CIL generation, Database Synchronize in AX 2012

1.) "A parameter could not be serialized":
For a quick resolve: uncheck option "Excute business operations in CIL"  under Tools-> Options -> Development tab.












The reason is that you haven't been able to do a successful FULL CIL compile.
Run again and try to fix the error in CIL.

2.)"CIL generation: source array was not long enough...":

1. Stop the AOS.
2. Delete all of the source in the C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL directory.
3. Start the AOS.
4. Perform a full CIL generation.
5.(Only do if errors are still there and you have no error when compile X++, just comment the code notice in Compiler output with /*..*/, recompile CIL and delete comment tag)

3.) "CIL generation error : The given key was not present in the dictionary":

1. Check the CIL log file, generally located at "C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL\Dynamics.Ax.Application.dll.log"
2. You will find the AOT object for which the CIL generator found the error.
3. Compile that object, fix the error, or delete (if needed) and then regenerate the IL.
4. (Only do if errors are still there : Stop AOS > Delete the .auc file from users\\Appdata  folder > Restart AOS)

4.) DB synchronize error: "Field mismatch in union query. Field ... is not compatible with field ..."

Check your EDT concern to that field ( in query, table, view). They have different size.
So you just change the size to be the same.
Or check someone changed size of standard EDT. It's the reason cause this error

5.) "Duplicate type with name 'Dynamics.Ax.application.' in assembly 'Dynamics.Ax.application "

1. Stop the ax service.

2. Truncate the SysXPPAssembly in db model
3. Delete all the files in below directory in server where AOS hosted:

C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL

4. Start the service

5. Compile full CIL

Friday, May 29, 2015

Exception from HRESULT: 0xC0048021 in DMF AX 2012 R3

If you're using Excel 2013 like I am, the problem is caused by tge DMConfig XML file.
Go to the DMConfig.xml file in the Microsoft Dynamics AX\60\DataImportExportFramework  folder and replace the PipelineComponentInfo_Multicast, PipelineComponentInfo_ExcelSource and  <PipelineComponentInfo_ExcelDestination> nodes by the following:
  <PipelineComponentInfo_Multicast>
    {33D831DE-5DCF-48F0-B431-4D327B9E785D}
  </PipelineComponentInfo_Multicast>
  <PipelineComponentInfo_ExcelSource>
    {9F5C585F-2F02-4622-B273-F75D52419D4A}
  </PipelineComponentInfo_ExcelSource>
  <PipelineComponentInfo_ExcelDestination>
    {90E2E609-1207-4CB0-A8CE-CC7B8CFE2510}

  </PipelineComponentInfo_ExcelDestination>


Thursday, July 31, 2014

Get field value from enterprise portal


Below code will help to get the value of the field from enterprise portal

we can retrive the value from Grid / group / form using below code

DataSetViewRow row = CurrentRow;
string accountnum= string.Empty;
        if (row != null)
        {
            accountnum= (string)row.GetFieldValue("custTrans!AcountNum");
        }

Thursday, July 3, 2014

How to delete Label Files from AX 2012

Here are the steps to delete Label Files from AX 2012:

  • Create a new model. You could call it "LabelsBeGone".
  • Open the AOT and move the Label File(s) you want to get rid of to the new model.
  • Close AX and stop the AOS.
  • Use AXUtil to delete the new model.
  • Delete the label files from the server folder; C:\Program Files\Microsoft Dynamics AX\60\Server\...\bin\Application\Appl\Standard
  • Start the AOS.
  • Skip the upgrade wizard.

Ax2012 EP error: The 'Metadata' property is read-only and cannot be set.


Solution:
1. Open the web control in Visual studio
2. Open the Design file of the web control (.ascx)
3. Click source button to view Ascx coding (HTML code)
4. Find(ctrl + F ) Metadata in the ascx code
5. Simply delete the word whereever it is appear in ascx file
6. Save and deploy the webcontrol.
7. Open the webpage again, the error is resolved.