This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
10 September 2022
Get object of Caller Form In Extension Class/ element to use in init extenion in D365Fo / Is it possible to get element.args() from an extended method in D365FO
Get the selected records in the form grid in class
class ClassParmData
{
CustTable
custTable;// table buffer declaration
}
public static void main(Args args)
{
ClassParmData
parmData;
Table1
table1;
FormDataSource
fds;
if(args.record().TableId
== tablenum(CustTable))
{
custTable
= args.record(); // assigning the selected record
}
fds
= custTable.dataSource();// getting the datasource
parmData=
new ClassParmData(fds); //passing the form datasource to New() method
}
void new(FormDataSource fdst) //
receving the datasource to fdst-FormDataSource
{
//
1st optoin to do this
MultiSelectionHelper
helper = MultiSelectionHelper::construct();
helper.parmDatasource(fdst);
custTable
= helper.getFirst();
while
(custTable.RecId != 0)
{
custTable
= helper.getNext();
}
//
second way
for(custTable
= fdst.getFirst(true); custTable; custTable = fdst.getNext()) //
fdst.getFirst(True) to select marked records
{
info(strfmt(custTable.Field1));
}
//if
you are updating some records in the form write the below line to refresh the
data in form.
//fdst.research();
}
void
parmFormDataSource(formDataSource fdst)
{
for(custTable
= fdst.getFirst(true); custTable; custTable = fdst.getNext()) //
fdst.getFirst(True) to select marked records
{
info(strfmt(custTable.Field1));
}
//if
you are updating some records in the form write the below line to refresh the
data in form.
//fdst.research();
}
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...