28 May’15

Dynamics AXConfigure Inbound Port in AX 2012 to handle Bigger size XML coming inside via AIF

1. The maximum size of the XML message that AX can receive is 64kb. In order to accept the XML of bigger size, we have to configure the Inbound port.


2. The web.config is created from the configuration of the inbound port. So, in order to preserve the changes even if the Inbound port gets reactivated, please make the changes as detailed below [Please refer to the below snapshots for your information]

a. Go to the Inbound port.

b. De-Activate the inbound port.

c. Click on “Configure” button as shown below [A pop up window will come]

d. Click “Yes” on the window popped up[Find below the snapshot of the popped up window]

e. Now go to Bindings basicHttpBindingWithWindowsAuth as highlighted in the below snapshot.

f. Now set the size of the property “MaxReceivedMessageSize” to a bigger value(like: 10485760).

g. Save the changes and close the form.

h. Click on Activate button to activate the Inbound port.

i. Check the Web Config file from the above file location and verify the value that was set in the previous “step-f”.

X++ code to fetch the data from Excel in AX 2012R2

I have come across the requirement to fetch the data from Excel in AX.
Below is the X++ code to do the same:

static void ImportDataFromExcel(Args _args)
    SysExcelApplication application;
    SysExcelWorkbooks workbooks;
    SysExcelWorkbook workbook;
    SysExcelWorksheets worksheets;
    SysExcelWorksheet worksheet;
    SysExcelCells cells;
    COMVariantType type;
    int row;
    ItemId itemid;
    Name name;
    FilenameOpen                    filename;
    dialogField                     dialogFilename;
    Dialog                          dialog;

    application = SysExcelApplication::construct();
    workbooks = application.workbooks();
    dialog = new Dialog("ExcelUpload");
    dialogFilename      =   dialog.addField(extendedTypeStr(FilenameOpen));
    dialog.filenameLookupFilter(["@SYS28576",#XLS, "@SYS28576",#XLSX]);
    dialog.filenameLookupTitle("Upload from Excel");
    dialog.caption("Excel Upload");


    filename            =   dialogFilename.value();
    application         =   SysExcelApplication::construct();
    workbooks           =   application.workbooks();
    catch (Exception::Error)
    throw error("File cannot be opened.");

    workbook = workbooks.item(1);
    worksheets = workbook.worksheets();
    worksheet = worksheets.itemFromNum(1);
    cells = worksheet.cells();
itemId = cells.item(row, 1).value().bStr();
type = cells.item(row, 1).value().variantType();
info(strfmt('%1', itemId));
while (type != COMVariantType::VT_EMPTY);
Written by

Team Member


Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more