Dynamics Search Engine

Showing posts with label Ax Integration. Show all posts
Showing posts with label Ax Integration. Show all posts

Tuesday, February 24, 2015

How to fix Data Migration Framework (DIXF) error in Microsoft Dynamics AX 2012 R3

How to fix Data Migration Framework (DIXF) error in Microsoft Dynamics AX 2012 R3

 
This article addresses:
How to resolve Data Import / Export Framework (DIXF) error.
How to resolve data upload error in Microsoft Dynamics AX 2012.
How to resolve error ‘could not load file or assembly … The system cannot find the file specified.




Applied on: Dynamics AX 2012 R3.
Prerequisite: Basic Dynamics AX 2012 programming knowledge.
Target audience: AX programmers.
Assumption: You are familiar with Dynamics AX 2012.

When you get an error to upload data using Data Migration Framework (DIXF), check below things.

- Data Import / Export Framework (DIXF) service should be installed on a computer running SQL Server Integration Services. This component provides the connection to SQL Server Integration Services.
In order to complete the installation, you must provide an account for the service to run as. AOS service account is recommended.
 

- AOS component should be installed on AOS server that connects the AOS to the Data Import/Export Framework service. If AOS component is installed correctly you should get a folder called  DataImportExportFramework under default location “C:\Program Files\Microsoft Dynamics AX\60” on AOS server. Inside this folder you should have:

DMFConfig
Microsoft.Dynamics.AX.Framework.Tools.DMF.DriverHelper
Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelper
Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService
Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe


- Client component should be installed on client system. It installs the user interface component of the Data Import/Export Framework. If client component is installed correctly the client bin folder should have 4 DLLs e.g.

Microsoft.Dynamics.AX.Framework.Tools.DMF.DriverHelper.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.Mapper.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.PreviewGrid.dll, Microsoft.Dynamics.AX.Framework.Tools.DMF.ServiceProxy.dll

The default location for these files is “C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin” on client machine. Your AOS server can be a client as well.
 

-     Open your AX client and go to Data import export framework module > Setup > Data import/export framework parameters. On this form you need to define a share folder path and validate. Important thing is the service account assigned to Data Import / Export Framework (DIXF) service on SQL server should have access to this folder.

 

-      On AOS server go to Start > Administrative Tools > Server Manager > Configuration > Local Users and Groups > Groups. In this Groups folder there must a group called Microsoft Dynamics AX Data Import Export Framework Service Users. In this group add service account (user ID) which you used for DIXF on SQL server. Also add users will be accessing DIXF.
 

-      Open your AX client and go to System administration > Setup > Services and Application Integration Framework > Inbound ports > make sure DMFService is activated.

 
Hope this was useful for you. Leave your comment below

Tuesday, January 6, 2015

How to read and insert record from a CSV file using X++ code into Microsoft Dynamics AX 2012 table

How to read and insert record from a CSV file using X++ code into Microsoft Dynamics AX 2012 table.

This article helps you to understand how to read data from a CSV file and insert into Microsoft Dynamics AX 2012 table.

Applied on: Dynamics AX 2012 R3.
Prerequisite
: Basic Dynamics AX 2012 programming knowledge.
Target audience
: AX programmers.
Assumption: You are familiar with Dynamics AX 2012 and CSV file


Below job inserts records from a CSV file to CustGroup table.

static void CustGroupCSVInsert(Args _args)
{
    Dialog          dialog  = new Dialog();
    DialogField     dialogField;
    AsciiIo         importFile;
    str             filePath,fileNameOnly;
    filetype        type;
    container       record;
    str             delimiter = ",";
    int             totalRecords;
    CustGroup       custGrp;

    dialogField=dialog.addField(extendedTypeStr(FilenameOpen),"Select File","Select file to import");
    dialog.caption("File Picker");
    dialog.filenameLookupFilter(['csv','*.csv']);

    if(!dialog.run())
        return;

    [filePath, fileNameOnly, type] = fileNameSplit(dialogField.value());
    importFile = new AsciiIo(dialogField.value(), 'R');

    if((!importFile) || (importFile.status() != IO_Status::Ok))
    {
        warning("Error in opening import file");
        throw(Exception::Error);
    }

    importFile.inFieldDelimiter(Delimiter);

    try
    {
        ttsbegin;
        custGrp.clear();
        record = importFile.read(); // First row - Column name - Header

        while(importFile.status() ==  IO_Status::Ok)
        {
            record = importFile.read();
            if(!record)
                break;

            totalRecords = totalRecords + 1;
            custGrp.clear();

            custGrp.CustGroup = conPeek(record, 1);
            custGrp.Name = conPeek(record,2);

            custGrp.insert();
        }
        ttscommit;
    }

    catch(Exception::Error)
    {
        Throw(Exception::Error);
    }

    info(strFmt("Total Read Records = %1",totalRecords));
}


Sample .CSV file image.



 

Tuesday, February 21, 2012

In Microsoft Dynamics AX 2012 during data import using Excel Add-Ins you may experience an exception or error

In Microsoft Dynamics AX 2012 during data import using Excel Add-Ins you may experience an exception like: “You must include at least two items in any list used for updating data.”

Applied on:
Microsoft Dynamics AX 2012 CU2.

Assumption:
This article is for those who has at least basic data flow and navigation
knowledge.

About this article:
This article may answers your question like-
• In Microsoft Dynamics AX 2012 how to handle exception during data import or data conversion?
• In Microsoft Dynamics AX 2012 how to copy master data from one environment to another environment and handle exception or error?
• In Microsoft Dynamics AX 2012 what are the new feature to export / import data?

Exception:

Resolution:
During data import using Excel Add-ins tool you need to select table(s). Once the table(s) is selected, by default system will select field(s) from table which is mandatory or part of primary index. If you have more than two fields like this then you will not face this exception or error. If there is one field which is mandatory or part of primary index in your table then system will select that field and put in the excel sheet and manually you need to select one more field along with this. In the above error screen if you see the red marked area where one more field to be added to get out of this exception.
Hope this is useful.

Tuesday, November 25, 2008

Integration between Microsoft Dynamics Ax and Microsoft Dynamics CRM

Hi guys,
If you are looking for an integration solution between Microsoft® DynamicsTM Ax and Microsoft® DynamicsTM CRM, there is cool tool for it. It's called 'Celenia CRM Connector' for Microsoft® DynamicsTM AX and NAV. The features and bevahors of this connection is great. Using this Celenia connector you can also connect you NAV application to your CRM application. To know more about it you can visit the link below.

Click here to visit website.
You can see a demo how to use celenia connector...
How to integrate CRM to Ax...
How to integrate CRM to NAV...




Saturday, November 8, 2008

How to use DLL or external DLL within Microsoft® DynamicsTM Ax

Here no article is published but it refers to an other article where I mentioned how to use CLR Interop or DLL.
Click here to see the article.

Monday, October 20, 2008

Microsoft® Dynamics™ Snap for Microsoft® Dynamics™ AX Sandbox

What is Microsoft® Dynamics™ Snap?
Microsoft® Dynamics™ Snap applications allow workers to access Microsoft® Dynamics™ data where and when they need it—while working in Microsoft® Office. It's one of the good features of Microsoft® Dynamics™ Ax.


Now Snap for Microsoft® Dynamics™ AX 2009 is available. To download the source code logon to click http://www.codeplex.com/axsnap.


The Business Data Lookup Snap-in enables an Information Worker to look for information in Microsoft Dynamics AX™ 2009 from within 2007 Microsoft® Office system applications. Using a task pane launched within Word, within Microsoft Excel® or within an email in Microsoft Outlook®, the Information Worker can
· Search for records like customers, contacts, sales orders, inventory items etc.
· View details of these records
· Browse data related to a particular record, e.g. all sales orders for a particular customer
· Select and copy data into the document
· Attach the document to a selected record in Microsoft Dynamics AX for reference


Some of available Microsoft Dynamics Snap applications are:
Business Data Search
Provides powerful search capabilities that allow an information worker/user to search for information across Microsoft business systems including Microsoft Dynamics AX and SharePoint Server portals from within Microsoft Office Outlook as simply as searching email.

Business Data Lookup
Allows an information worker/user to search for and insert Microsoft Dynamics AX into a Microsoft Office Word document, Excel spreadsheet or Outlook email, all without ever having to leave the Microsoft Office interface. The document or spreadsheet that is created can also be attached to the Microsoft Dynamics record for later reference.

Custom Report Generator
Enables an information worker/user to extract, view and analyze data residing in Microsoft Dynamics AX as neatly formatted reports within Microsoft Office Excel. Creating a new report or editing an existing one is easy since the reports are generated from meta-data that defines what data to show, where to surface it and what formatting to apply.

Timesheet Management
Allows an information worker/user to use their Outlook Calendar entries to submit timesheets without having to log into Microsoft Dynamics AX directly.

Vacation Management
Enables an information worker/user to use their Outlook Calendar to submit vacation requests without having to log into Microsoft Dynamics AX directly.

Expense Management
Allows an information worker/user to easily create, submit and approve or reject expense reports in SharePoint, without having to log into Microsoft Dynamics AX directly.

Customer Journal
Enables a salesperson to take an offline InfoPath record of all pertinent customer information to a sales meeting, access that information from their desktop, revise that information as needed, then synchronize their changes in the Microsoft Dynamics AX system once they are back online.

For more information you can see the Microsoft website http://www.microsoft.com/dynamics/product/snap.mspx

Saturday, September 20, 2008

How to use CLR Interop with Dynamics Ax 4.0

This article will explain you how to use CLR Interop with Dynamics Ax 4.0.

Write your business logic in .Net environment and use that within Dynamics Ax.

It assume that you are familiar with Microsoft Dynamics Ax and Visual Studio .Net
You should have Ax 4.0 & Visual Studio .Net installed on your system.
There is No warranty on this article, use at your own risk. If it’s useful then refer to others.

.NET CLR Interop Overview
Classes in assemblies that are managed by the common language runtime (CLR) can be accessed in X++ code. This feature of Microsoft Dynamics AX is called common language runtime (CLR) interoperability, or CLR interop.
The CLR interop feature works only in the direction from X++ calling into CLR managed assemblies. It does not support calling X++ classes from a CLR managed assembly.
CLR interop is useful when you want your X++ code to access the functionalities in a CLR managed assembly.


1.
Open Visual Studio and create a new project. During creating a new project area, choose programming language Visual C# and template Class library. I have given the project name TalkToDotNet.








Figure 1.















Figure 2.

2.
By default you will get a standard class template as below:
using System;
using System.Collections.Generic;
using System.Text;

namespace TalkToDotNet
{
public class Class1
{
}
}



3.
Now add the following lines within Class1
public string CombinedMsg(string _msg)
{
string message1;
message1 = _msg;
return message1 + "From .Net: I am fine";
}

After addition the above lines the class1 will look like:

using System;
using System.Collections.Generic;
using System.Text;

namespace TalkToDotNet
{
public class Class1
{
public string CombinedMsg(string _msg)
{
string message1;
message1 = _msg;
return message1 + "From .Net: I am fine";
}
}


}



The above class is having a method called CombinedMsg which takes a string parameter and add "From .Net: I am fine" string with the parameter string.

4.
Now go to the project explorer window and select the project. Right click on the project and click on Properties. You will get the window as below.


Figure 3.

5.
Click on Signing Tab and then check the check box Sign the assembly.


Figure 4.

6. Choose New from the drop down box as shown below.


Figure 5.

7.
It will ask you for user id and password to protect your business logic. This is optional. You may ignore.

Figure 6.


8.
Click on Build menu then Build Solution.

Figure 7.

If any error is there then you will be prompted otherwise you will get the successful message. Now copy the dll from your project area and paste it to Bin directory of your Ax client folder.


9.
Now open your Ax application.


10.
Open AOT, select the References node and right click on it. On the context menu click on Add reference.

Figure 8.


11.
You will get the window as below. Click on Browse button and go to the Bin folder of your Ax client folder.

Figure 9.




Figure 10.




Figure 11.


12.
See the dll is added.

Figure 12.

13.
The dll is now added in the references node of AOT.


Figure 13.


14.
Now create a job in Ax and call the dll.

Figure 14.



Figure 15.


15.
The job is as below.

Figure 16.


static void TalkToDotNet(Args _args)
{
str strval;
TalkToDotNet.Class1 testCls = new TalkToDotNet.Class1();
strval = testCls.CombinedMsg('From Ax: How are you? ');
print strval;
pause;
}

16.
See the print message below. It takes a string message from Ax and adds it with the message returned by dll.

Figure 17.

Hope it would a helpful article for you guys.




Monday, April 7, 2008

How to use .Net Business Connector for Dynamics Ax 4.0 within .Net

NOTE: No warranties, use at your own risk.

Requirement :
1) Ax 4.0 with .Net Business Connector
2) Visual Studio 2005 (preferred)

Business Connector enables third-party applications to interface with Microsoft Dynamics AX as though they were a native Microsoft Dynamics AX client. Applications built using the Microsoft .NET Framework or ASP.NET can now interface with Microsoft Dynamics AX using the .NET Business Connector. The .NET Business Connector is integrated with Enterprise Portal and Web services. You can leverage the benefits of these other applications and services by installing the .NET Business Connector.


Open your visual studio.
Click on File>New>Project. New Project window will open. Select Visual C# from Project types and Windows Application from Templates. Give a name in the Name field and click on OK button.














By default Form1 will be added to your project.
From Toolbox add a button and a textbox to the form as shown below:



















Double click on the button.
Now see the default code below:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DotNet2Ax //your project name
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

}
}
}

Click on menu Project >Add Reference…
It will give you the dialog as below:

















Click on Browse tab and browse the Ax 4.0 Client folder then Bin and locate Microsoft.Dynamics.BusinessConnectorNet.dll as shown below:


















Click OK button.

Now add the below lines in the button1_Click method.

Microsoft.Dynamics.BusinessConnectorNet.Axapta DAX = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
Microsoft.Dynamics.BusinessConnectorNet.AxaptaRecord DAXRec;
DAX.Logon(null, null, null, null);
DAXRec = DAX.CreateAxaptaRecord("CustTable");
DAXRec.ExecuteStmt("select firstonly * from %1");
textBox1.Text = (string) DAXRec.get_Field("name");

After adding the lines it will look like:
private void button1_Click(object sender, EventArgs e)
{
Microsoft.Dynamics.BusinessConnectorNet.Axapta DAX = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
Microsoft.Dynamics.BusinessConnectorNet.AxaptaRecord DAXRec;
DAX.Logon(null, null, null, null);
DAXRec = DAX.CreateAxaptaRecord("CustTable");
DAXRec.ExecuteStmt("select firstonly * from %1");
textBox1.Text = (string)DAXRec.get_Field("name");

}

Now click on Build>Build Solution.
Click on Debug>Start Debugging. Your Form1 will run. Click on the button and see the value of CustTable field ‘Name’.



















Code Description:
DAX.Logon(null, null, null, null);
The above method takes logon criteriaon/parameters
Company, Language, ObjectServer, Configuration all are in string

DAXRec = DAX.CreateAxaptaRecord("CustTable");
In the above line table name has been specified.

DAXRec.ExecuteStmt("select firstonly * from %1");
In the above line select statement has been specified.

textBox1.Text = (string)DAXRec.get_Field("name");
In the above line selected record of field name is being assigned to the textBox control.