I need to import from excel Customer(Arabic) name into "CustTable" this field is customized field and the data stored in "CustTable". How can i Import that data.
*This post is locked for comments
You didn't say before that you're on Feature Pack. Here is a link explaining how to install DIXF there.
Thanks for your response but Mr.DavidGunawan i tried this with excel it shows me you update 100 reccords but after refresh it'll not shows any update
Thanks Mr.Chandan Sharma but i tried this one before but its not working
thanks for response but Mr. Martin Drab in AX2012 Feature Pack Layer their is no any module for Data Import Export Framework it's available in AX2012 R2,R3. but i have ax2012.
The recommended way for importing data is the Data Import Export Framework.
Hi,
You can use excel add-ins to export and import data from/to AX.
For more detail in your case, you can follow the link below.
ax2012exceldataimport.blogspot.sg/.../dynamics-ax-2012-customers-import-using.html
With this you also able to import the customized field only and It's simpler (In the case of the Customer data is exist and you just want to update the customized field).
Regards
You can create a job to import the data through excel as CSV doesnot supports arabic.
the code will be somewhat as below
custtable custtable ;
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet,worksheet1;
SysExcelCells cells,cells1;
COMVariantType type,type1;
int row=0;
int inserted =0;
Accountnum accountnum ;
Dialog dialog;
DialogField dfFileName;
FileName fileName;
#file
#AviFiles
;
dialog = new Dialog("Pick the file");
dfFileName = dialog.addField(extendedTypeStr(FileNameOpen));
dialog.filenameLookupFilter(["All files", #AllFiles]);
if(dialog.run())
{
filename = dfFileName.value();
}
application = SysExcelApplication::construct();
workbooks = application.workbooks();
workbooks.open(filename);
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromName("ArabicNames");
cells = worksheet.cells();
do
{
row++;
custtable .clear();
accountnum = cells.item(row,1).value().bStr();
custtable =custtable ::find(accountnum ,true);
if(custtable .recid > 0)
{
ttsBegin;
custtable .ArabicName = cells.item(row,2).value().bStr(); //replace arabicname with your field
custtable .update();
inserted++;
ttsCommit;
}
type = cells.item(row+1, 1).value().variantType();
}
while (type != COMVariantType::VT_EMPTY);
info(strFmt("%1 records updated out of %2", inserted,row));
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156