Skip to main content

Code to call Display method in Workflow class in Ax 2012

If you want to show display method of table in workflow designer then you need to write method on table and class .

For example table method to get customer credit limit value.

 display AmountMST Cust_CreditLimit()  
 {  
   ;  
   return CustTable::find(this.CustAccount).CreditMax;  
 }  

Then go to document class for e.j. \Classes\PurchTableDocument and create new method like this.


 public AmountMSTParmCreditLimit(CompanyId _companyId, TableId _tableId, RecId _recId)  
 {  
   CustTable CustTable;  
   select CustTable where CustTable.recid==_recId;  
   return CustTable.Cust_CreditLimit();  
 }  


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...