Bojensen Blogs

Tag: X++

RunBase Framework Extension – Inside Microsoft Dynamics Ax 4

  RunBase Framework Extension Use the RunBase framework throughout Dynamics AX whenever you must execute a business transaction job. Extending the RunBase framework allows you to implement business operations that do not have default support in the Dynamics AX application. The RunBase framework supplies many features, including dialog boxes, query windows, validation-before-execution windows, the progress…

Creating a Order through X++

  static void createPurchase(Args _args) { AxPurchTable table; AxPurchLine line; ; table = new AxPurchTable(); table.OrderAccount(‘3023’); table.save(); line = new AxPurchLine(); line.axPurchTable(table); line.itemId(‘Q987’); // Item number Q987 line.purchQty(12); // 12 pcs. line.save(); } Creating a Order through X++

Dynamics AX: Confirm a Sales Order through code

  Confirm a Sales Order through code Over the next few days I am going to post code that walks through the sales life cycle. To start below is code that will take a given SalesId and confirm it. public boolean confirmSalesOrder(SalesId _salesId) { SalesFormletter SalesFormletter; SalesTable SalesTable; ; SalesFormletter = SalesFormletter::construct(DocumentStatus::Confirmation,true); SalesTable.clear(); SalesTable =…

Dynamics AX: Read All Files inside a directory

 void FindAllCSV() { #Evat_NL #File Filename baseFolder; Filename csvFilename; Filename foundBaseFileName; Filename foundFileName; container mainFolder, subFolder, fileContainer; boolean filesFoundMainFolder = true; boolean filesFoundSubFolder = true; int apiResult; int setCurrentFolder (Filename _filename = ”) { ; return WinAPI::setCurrentDirectory(_filename); } ; baseFolder = “C:TEST”; apiResult = setCurrentFolder(SysTreeNode::duplicatePathDelimiters(baseFolder)); mainFolder = WinAPI::findFirstFile(“*.*”); foundBaseFileName = conpeek(mainFolder, 2); while (filesFoundMainFolder) {…