Monday, August 6, 2012

AIF 2012 - Adapter register

Adapters that are included with Microsoft Dynamics AX are automatically registered during installation. Whenever a new adapter is added to the Application Object Tree (AOT), you must register the adapter to make it available in the integration ports. To register adapters, follow these steps.
1. Click System administration > Setup > Checklists > Initialization checklist.
2. Expand the Initialize system node.
3. Click Set up Application Integration Framework.
Adapters, basic ports, and services are registered. This operation can take some time to be completed.

Tuesday, February 28, 2012

Reading comma separated files in AX 2012

Example of the CommaIO class

FileName fileName = 'c:\\test.csv';
FileIoPermission permission;
CommaIO commaIO;
container readCon;
int i;
int level;
str column1;
str column2;
str column3;
;
permission= new FileIoPermission(filename,'r');
permission.assert();
commaIO = new CommaIo(filename, 'r');
commaIO.inFieldDelimiter(';'); // Delimiter...
if (commaIO)
{
while (commaIO.status() == IO_Status::OK)
{
readCon = commaIO.read();
column1 = conPeek(readCon, 1);
column2 = conPeek(readCon, 2);
column3 = conPeek(readCon, 3);
info(strFmt("%1 - %2 - %3", column1, column2, column3));
}
}