Skip to main content

Posts

Showing posts with the label sales

Dynamics AX 2012 Reporting: How to specify new design for Sales order confirmation

Sales order confirmation report is one of the special reports which are manage by print management. When we create new design in Visual Studio for out Sales order confirmation report and we want to use it it is not enough to change the code. Even those we will change the code in class AOT\Class\SalesConfirmationController method main from: controller.initArgs(_args,ssrsReportStr(SalesConfirm,Report) to controller.initArgs(_args,ssrsReportStr(SalesConfirm,Report_NewDesign) that will not be picked up and sales confirmation will be still printed in old design. To change the design you need to: If you go to Account receivable > Setup > Forms > Form setup Click on button Print management You will see that by default report format is set up to: SalesConfirm.Report If you want to use every time your new design then you can select for Report format your desire design. If your desire format does not appear in drop down list you will need to edit method popula...

calculate total sales order or sales quotation amount / discounts / tax etc., through code( X++ ) in AX

this can be achieved through code using SalesTotals class. Check out the below code snippet. SalesTotals   salesTotals; SalesTable   salesTable; container   displayFields; str     totalTax, amountWithoutTax, amountInclTax; salesTable = salesTable::find('SO-1112345'); salesTotals = SalesTotals::construct(salesTable, salesUpdate::All); salesTotals.calc(); displayFields = salesTotals.displayFieldsCurrency( salesTotals.currencyCode() ); amountWithoutTax = conpeek(displayFields, TradeTotals ::posBalance()); amountInclTax   = conpeek(displayFields, TradeTotals::posTotalAmount()); totalTax    = conpeek(displayFields,TradeTotals::posTaxTotal()); In the above way, we can get all the values available in the totals form in the Sales Order Form by changing the TradeTotals values. We can get the values in the desired currency by providing a valid currency as a parameter to the displayFieldsCurr...

sales price and cost price

sales price B_RepairJournalOrderLines.ProjSalesPrice = InventTable::find(B_RepairJournalOrderLines.ItemId).LastUserPrice; cost price     B_RepairJournalOrderLines.ProjCostPrice = InventTableModule::find(B_RepairJournalOrderLines.ItemId,ModuleInventPurchSales::Sales).price() ;