Skip to main content

Posts

Show/Hide the dialog range field

To hide/show the query dialog field, you need to implement/override the showIndexFields() method of the dialog and return FALSE if you want to hide the field from the dialog query range. here is an example: public boolean showIndexFields(tableId _tableId) { boolean ret = true; switch (_tableId) { case tableNum(YourTable): ret = false; break; } return ret; }

Dynamics AX 2009 and Dynamics AX 2012 modules comparisons

Following are the enhancements made by Microsoft on Dynamics AX 2012: For example, GL module in AX 2009 is now break into GL and Fixed assets in AX 2012. AX 2009 Module AX 2012 Module General Ledger General Ledger Fixed Assets (New) Bank Cash and bank management Accounts Payable Accounts Payable Procurement and sourcing (New) Accounts Receivables Accounts Receivables Sales and Marketing (New) Inventory Management Product information (New) Inventory and warehouse management Expense management Travel and expense management Production Production control Project Project management and accounting Compliance and internal control (New)

Set focus on specific control when opening form

To set the focus on specific control when form is open, you need to override the firstField() method of the form and set your desired control after super() call. public void firstField(int _flags=1) { ; super(_flags); desiredControlName.setFocus(); }

Modify InvoiceDate, TransDate .. on already posted Vendor Invoice

you have to try first run test system . static void xxx(Args _args) { invoiceId NumFacturaDesde; invoiceId NumFacturaHasta; CustInvoiceJour _custinvoicejour; CustInvoiceSalesLink _custinvoicesaleslink; CustInvoiceTrans _custinvoicetrans; LedgerTrans _ledgertrans; CustTrans _custtrans; CustTransOpen _custtransopen; InventTrans _inventtrans; TaxTrans _taxtrans; CustBillOfExchangeInvoice _CustBillOfExchangeInvoice; CustBillOfExchangeTrans _CustBillOfExchangeTrans; CustSetTlement _CustSetTlement; InvoiceDate FechaBuena; ; //Inicializamos variables NumFacturaDesde = '035884'; NumFacturaHasta = '035884'; FechaBuena = str2date("22.04.2005",123); ttsbegin; _custinvoicejour.clear(); SELECT FORUPDATE * FROM _custinvoicejour WHERE _custinvoicejour.InvoiceId>=NumFacturaDesde && _c...

Finding unused labels in Dynamics Ax 2009

static void FindUnUsedLabels() { str 50 labelId; str labelString; int i; //set max label to the highest number of labelId in your application int maxLabel = 2000; xRefNames names; XRefReferences ref ; ; while (i <= maxLabel) { //Sequential generation labelId = "@IFC" + int2str(i); //Find if the label id has an cross reference //record select recid from names where names.Name == labelid exists join ref where names.RecId == ref .xRefNameRecId; labelString = SysLabel::labelId2String(labelId); //If there is no record in cross reference then log it if (! names.RecId && //avoid logging labels that are already deleted (This is because of sequential check like IFC1, IFC2, IFC3 etc...) ...

Quick Excel report – Dynamics Ax 2009

Excel is the most convenient software to examine changes in data. Specially when you have made them code and wanted it to be tracked. That’s is one of the many reasons why excel tops to be the most used software in the world. This article in detail will tell you how to create an ad hoc excel sheet just in case you wanted to show data changes, compile information from different tables etc. static void JobExportToExcel(Args _args) { SalesLine salesLine, oldSalesLine; str text; TextIO io; #WinAPI ; //Column header for the excel. The header fields and the data field must match //in number and order //You can use anything as a delimiter but # is convenient as this rarely appears //as data (other choices ~, |) text = 'Order # Customer # Item # Lot id # New tax group # Old tax group \n' ; select * from salesLine where salesLine.TaxItemGroup == 'GST' || ...

Posting Invoice from Sales order/ Purchase order

static void postSalesInvoice(Args _args) { // Define a classvariable according to the // type of posting being performed SalesFormLetter_Invoice invoice; SalesTable salesTable; ; // Select the salesTable to update salesTable = SalesTable::find(“SO-101297″); // Create a new object of the SalesFormLetter_Invoice // by using the construct-method in SalesFormLetter invoice = SalesFormLetter::construct(DocumentStatus::Invoice); // Post the invoice invoice.update(salesTable, SystemDateGet(), SalesUpdate::All, AccountOrder::None, false, true); // Set to true to print the invoice } The next screenshot shows the class hierarchy of FormLetter with all its subclasses: we can easily custamize the above logic to post different status updates against sales orders and purchase orders Sales (Confirmation, Picking list, Packing slip, Invoice ) Purch (Purchase order,Receipt list, Packing slip, Invoice)