TextBuffer tb = new TextBuffer(); FileName myfile; // path to the csvfile tb.fromFile(‘myfile’); info(int2str(tb.numLines)); Counting lines from textfile in Axapta Programming
Måned: april 2011
Microsoft Dynamics Ax
Posting SalesOrder Confirmation with SalesFormLetter Class in Ax
by Bo Jensen •
The Book of orders in Microsoft Dynamics AX is done through the class “sales form letter” or one of its more concrete (derived) classes. Each reservation type (eg confirmation, delivery note, invoice) is represented by a class that is derived from the base class “sales form letter” (see illustration). To reserve an order by code,…
Microsoft Dynamics Ax
Creating a Order through X++
by Bo Jensen •
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++
Microsoft Dynamics Ax
Dynamics AX: Confirm a Sales Order through code
by Bo Jensen •
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 =…
Microsoft Dynamics Ax
Dynamics AX: Read All Files inside a directory
by Bo Jensen •
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) {…
Microsoft Dynamics Ax
How to import multiple file from a folder? – Microsoft Dynamics AX
by Bo Jensen •
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…
Microsoft Dynamics Ax
Creating Purchase Orders Through code in ax 2009
by Bo Jensen •
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
Microsoft Dynamics Ax
Creating Sales Orders Through code in ax 2009
by Bo Jensen •
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…
Microsoft Dynamics Ax
Simpel dialog box i Dynamics AX
by Bo Jensen •
static void DialogSampleCode(Args _args) { Dialog dialog; DialogField field; ; dialog=new Dialog(“My Dialog”); dialog.addText(“Select your favorite customer:”); field = dialog.addField(typeid(CustAccount)); dialog.run(); if(dialog.closedOk()) { info(field.value()); } }
DotNET
Unit Testing Using Visual Studio 2010: ASP Alliance
by Bo Jensen •
This article will demonstrate how to use Visual Studio 2010 to develop, run, and maintain unit tests. Unit Testing Using Visual Studio 2010: ASP Alliance
