Posts

Showing posts from April, 2016

X++ load operating units for financial dimensions CSV import

static void LoadDepartmentCost(Args _args) {     #File     OMOperatingUnit ou,ou2;     OMOperatingUnitType t;     RecId omOpRecId;     NumberSeq num;     IO  iO;     FilenameOpen        filename;// = "c:\\share\\test.csv";//To assign file name     Container           record;     str type;     int counter = 5, alreadyExists = 0;     Dialog          dialog;     DialogField     dialogfileName;     //dialog to load the excel file of contact information         dialog = new Dialog("Upload File");         dialogFilename = dialog.addField(extendedTypeStr(FilenameOpen));         dialog.filenameLookupFilter(["All files",#AllFiles]);         //dialog.filenameLookupTitle("Employee Data");         dialog.caption("Upload");     if(dialog.run())     {        filename = dialogFilename.value();     }     iO = new CommaTextIo(filename, #IO_Read);     if (! iO || iO.status() != IO_Status::Ok)     {         throw error(