Langsung ke konten utama

Postingan

Menampilkan postingan dari Januari, 2017

Write Ax Data to Txt in various Format

Public   void  sendTo_file(Editor  e) {     Filename filename;     TextIo io;      int  i =  strFind (e.path(),  '\\' ,  strLen (e.path()), - strLen (e.path()));      str  defaultName =  subStr (e.path(), i+ 1 ,  strLen (e.path()));     ;     filename = WinAPI::getSaveFileName( 0 , [ 'Text' , '*.txt' ],  '' ,  "@SYS56237" ,  'txt' , defaultName );      if  (filename )     {          // BP deviation documented          io =  new  TextIo(filename,  'W' ,  65001 );  // Write the file in UTF8         io.write(EditorScripts::getSelectedText(e));     } } > File for our future reference. /* UTF Encoding Format */ #define.utf7Format (65000) #define.utf8Format (65001) #define.utf16Format (1200) #define.utf32format (12000) #define.usascii (20127)

X++ code to import data from text file(.txt) to Ax Tables

This the code to insert data from txt to AX static void Notepad(Args _args) { FilenameOpen filename; dialogField dialogFilename; Dialog dialog; TextIO file; NotepadTable notepadTable; container con; str conitem,conitem1,conitem2; int i; #File   ; dialog = new Dialog("Notepad Upoad"); dialogFilename = dialog.addFieldValue(extendedTypeStr(FilenameOpen),filename,"File Name"); dialog.filenameLookupFilter([".txt", #AllFiles]); dialog.filenameLookupTitle("Upload from Text File"); dialog.caption("Upload from text file"); dialogFilename.value(filename); if(!dialog.run()) return; filename = dialogFilename.value(); file = new TextIO(filename, #IO_READ); file.inRecordDelimiter('\n'); //For Next Record file.inFieldDelimiter('\t'); ttsbegin; while(file.status() == IO_STATUS::OK) { con = file.read(); conitem = conpeek(con,1); if(conItem!="0") { notepadTable.initValue(); notepadTable.Name=

Force complete CIL recreation in MS Dynamics AX 2012

Prerequisite: Make sure that a full X++ compile was run without errors before 1) Stop all relevant AOS server(s)  2) On your relevant AOS server(s) navigate to the following folder (default) using Windows Explorer:  C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL  3) Make sure you create a safe copy of the XPPIL folder content to another new local folder on the AOS computer (example: C:\XPPIL_SAVE)  4) Now delete all folders and files inside the folder “C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL” but keep the folder “XPPIL” itself.  5) Start all AOS server(s)  6) Run a full CIL creation from AOT. This will create a fresh rebuild of all files/ folders inside the XPPIL folder