Thursday, July 6, 2023

Add date range with date less than current date (filter records with date less than or equal to today date) d365 , x++

 Create COC of form's data source and add this code in ExecuteQuery method that datasource


[ExtensionOf(formDataSourceStr(SalesTable , SalesLine))]
final class KA_SalesLineDS_Extension
{
    public void executeQuery()
    {
	this.query().dataSourceTable(tableNum(SalesLine)).addRange(fieldNum(SalesLine , InvoiceGenerationDate)).value(SysQuery::value(dateNull() + 1) + ' .. ' +  SysQuery::value(today()));
    }
}
SysQuery::value(dateNull() + 1) + ' .. ' +  SysQuery::value(currentDateTime)

This is the range of date less than or equal to Today date.

No comments:

Post a Comment

Change SSRS Report Design Based On Condition , D365 ,X++

 To change Sales Invoice control document's design based on condition use following code. Here I have created COC of salesInvoiceControl...