Skip to main content

Posts

Showing posts with the label salestable

X++ code for Project Item Requirement posting in Ax 2012

Below is the X++ code for Project Item Requirement posting in Ax 2012. SalesFormLetter salesFormLetter; salesTable Salestablelocal; str 200 msg; if(this.parmSalesid()) { changeCompany(_legalentity) { select Salestablelocal where Salestablelocal.Salesid ==this.parmSalesid() && Salestablelocal.salestype==SalesType::ItemReq && Salestablelocal.SalesStatus==SalesStatus::Backorder; if(Salestablelocal) { ttsBegin; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation); salesFormLetter.update(Salestablelocal); salesFormLetter = SalesFormLetter::construct(DocumentStatus::ProjectPackingSlip); salesFormLetter.update(Salestablelocal); ttsCommit; msg = "Item Requirement with Sales order id : " + this.parmSalesid() + " Posted "; } else ...

Code to get total Tax amount from sales order in MSD axapta

To gett total Tax amount of sales order in axapta you can try below code in job . SalesTotals salesTotals; SalesTotals_Trans salesTotals1; SalesTable salesTable; SalesLine salesLine; TaxAmountCur Amount,amt1; Tax tax; ; salesTable = SalesTable::find("S0000343_052"); salesLine = SalesLine::find(salesTable.SalesId); salesTotals = SalesTotals::construct(salesTable); tax = Tax::construct(NoYes::No); Amount = salesTotals.totalTaxAmount(); info(Strfmt("The tax amount is %1",Amount ));

Update Invoice date in salesTable in MSD axapta

If you want to show invoice date in sales order form then you need to add field invoicedate in salestable and update date using following code. CustInvoiceJour custinvoiceJour1; SalesTable SalesTable1; ; while select forupdate * from SalesTable1 where SalesTable1.InvoiceId=="" && SalesTable1.SalesStatus==SalesStatus::Invoiced { select custInvoiceJour1 order by invoicedate desc where custInvoiceJour1.SalesId == SalesTable1.SalesId && custInvoiceJour1.SalesId != ""; ttsbegin; SalesTable1.InvoiceDate=custInvoiceJour1.InvoiceDate; SalesTable1.update(); ttscommit; }