Many times, we do receive a requirement from the customer to show Date range filter controls in Entity List Page in Dynamics 365 Portal. The existing filter option will only accept a fixed value to be added in filter control and there is no OOB way to add date range filter in Entity List.
But we can add Date Range Filter control as shown below using the below steps.
In our example, we have used ‘RequestedShipDate’ field to get the Order Entity Details.
Step 1: Make a fetch XML filter on entity list as per our need
Fetch XML filter for ‘RequestedShipDate(On or After)’
Fetch XML filter for ‘RequestedShipDate(On or Before)’
P.S We need to define type as ‘dynamic’ so that portal will not perform any data transformation on filter options.
Step 2: Change the check boxes to Text controls
The Fetch XML filter controls will be displayed as checkboxes in the Entity List Page as shown below. We need to change the ‘type’ as ‘text’ for the checkbox controls to set value for the Dates.
Change the ‘Ship From Date’ check box as Text Box
//Change the ‘checkbox’ control’s type as Text
//Set Unique Id for the control
//Hide the control
//Set null value for the Dates
Follow the same above steps to change the ‘Ship To Date’ check box as Text Box