Bojensen Blogs

Tag: MorphX

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) {…

How to import multiple file from a folder? – Microsoft Dynamics AX

container createListOfFiles(FilePath _path = path, FileNameType _pattern = pattern) {     System.Array    files;     int             fileCount;     int             i;     str             nextFile;     new InteropPermission(InteropKind::ClrInterop).assert();     info(strfmt(‘Search in: %1 %2’, _path, _pattern));     listOfFiles     = connull();     actIx           = 0;     files           = System.IO.Directory::GetFiles(_path, _pattern);     if (files)     {         fileCount =    files.get_Length();         info(strFmt(‘Number of…

Creating Purchase Orders Through code in ax 2009

  static void createPurchOrder(Args _args) { AxPurchLine axPurchLine = new axPurchLine(); AxPurchTable axPurchTable = new axPurchTable(); ; axPurchTable.parmPurchId();///Creates new PurchId axPurchTable.parmOrderAccount(‘1001’);///Vendor Account axPurchTable.save(); axPurchLine.parmPurchId(axPurchTable.parmPurchId());////Assigns PurchId axPurchLine.parmItemId(‘PolyEthylene’);///Item Number axPurchLine.axInventDim().parmInventSiteId("Unit1");///Site Id axPurchLine.axInventDim().parmInventLocationId("RM");/// Warehouse axPurchLine.parmPurchQty(1000);///Quantity axPurchLine.parmPurchPrice(20);///Purchase price per one quantity axPurchLine.save(); } kranthi AX: Creating Purchase Orders Through code in ax 2009

Creating Sales Orders Through code in ax 2009

  static void createSalesOrder(Args _args) { AxSalesLine axSalesLine = new axSalesLine(); AxSalesTable axsalesTable = new axSalesTable(); SalesId salesId; ; salesId = axsalesTable.parmSalesId();///Creates sales Id axsalesTable.parmCustAccount(‘1104’); axsalesTable.save(); axSalesLine.parmSalesId(axsalesTable.parmSalesId());////assigns sales Id axSalesLine.parmItemId(‘PolyEthylene’);/// Item Id axSalesLine.axInventDim().parmInventSiteId("Unit1");///Site axSalesLine.axInventDim().parmInventLocationId("RM");///Warehouse ////if you have more dimensions enabled for item add here. axSalesLine.parmSalesQty(1000);///Quantity axSalesline.parmSalesPrice(20);///Sales Price per one quantity axSalesLine.save(); } kranthi AX: Creating…