Dynamics AX Blog - Posts from September 2015
These posts are machine-translated.
Open query window when opening formTo open the query-windows when opening a form, you can use the following code for example: public void run() { super(); if(dataSourceName_ds.queryRun().prompt()) { dataSourceName_ds.research(); } }
|
Cancel salesline through codeThe code is based on the logic in the form SalesUpdateRemain ("Deliver remainder" button in the sales order header). static void cancelSalesLine(Args _args) { boolean updated; SalesLine salesLine; try { ttsBegin; salesLine = SalesLine::findInventTransId('012411', true); updated = SalesUpdateRemain::updateDeliveryRemainder(salesLine, 0, 0); if(updated) { info("Salesline canceled"); } ttsCommit; } catch { error("SalesLine could not be canceled"); } } |
|
|
|
|
|
|
Example of how you can create a non-primary address for an entry in the global address book via code.