Skip to main content

Update and Update_RecordSet Code sample in Ax 2012

This is Update and Update_RecordSet Code sample. Result of both will be same .

 TestTable TestTable;  
   
//Update_Recordset
update_recordset TestTable setting Name ="New Enterprises" where TestTable.Accountnum =="uS-027";  
   
//Update
ttsBegin;  
   while select forupdate TestTable where TestTable.Accountnum =="uS-027"  
   {  
     TestTable.Name ="New Enterprises";  
     TestTable.update();  
   }  
   ttsCommit;  
   info("OK");  

Popular posts from this blog

X++ Code to run SSRS Report with parameter in D365 F&O (Example Sales Invoice )

Below is sample X++ Code to run SSRS Report with parameter in D365 F&O (Example Sales Invoice )      Args                       args = new Args();     CustInvoiceJour            custInvoiceJour;     SalesInvoiceJournalPrint   salesInvoiceJournalPrint;       select firstonly custInvoiceJour where custInvoiceJour.SalesId != '';       // Add record to be printed.     // In order to have the context table we need to set args.record().     args.record(custInvoiceJour);       salesInvoiceController = new SalesInvoiceController();     salesInvoiceController.parmReportName(         PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat());       salesInvoiceContract = salesInvoiceController.parmReportContrac...