Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Thursday, May 19, 2022

Get current record or select datasource of formDataSource extension of a form in D365

  Hi,

[ExtensionOf(formDataSourceStr(SalesTable, SalesLine))]

final class Dpay_SalesTable_SalesLine_FDS_Extension

{

        //init of SalesLineDS of SalesTable form

void initValue()

{

FormDataSource     formDataSource = this;


SalesLine    salesLine = formDataSource.cursor();

                

                //your logic        


next initValue();


//Your logic

}

}


Regards,


How to select the datasource of a form when you are the extension of formDatasource of another table in D365

 Hi,

[ExtensionOf(formDataSourceStr(SalesTable, SalesLine))]

final class Dpay_SalesTable_SalesLine_FDS_Extension

{

        //init of SalesLineDS of SalesTable form

void initValue()

{

FormDataSource     formDataSource = this;


SalesLine    salesLine = formDataSource.cursor();

SalesTable  salesTable = formDataSource .formRun().dataSource( formDataSourceStr( SalesTable, SalesTable)).cursor();

                

                //your logic        


next initValue();


//Your logic

}

}


Regards,



How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...