Date filters generally define a time interval where results should be located. Using “DateRange” filters, the developer can easily add a filter which will allow the user to define the interval using a “From” and “To” date.
In many cases some intervals (relative to the current date) are used very frequently, sometimes even exclusively. In those cases, the user will probably prefer to select the interval, rather than selecting its start and end dates. To support this scenario, K2BTools includes two types of "DateRange" filters: “Manual”, and “Semantic”. The developer can choose between them, using the “Date Range Type” property.
- Go to the EntityServices instance associated with the "Invoice" transaction.
- Add a new filter with the following properties:
- Name: "InvoiceDate"
- BasedOn: "InvoiceDate"
- FilterType: "DateRange"
|
FilterType: Date Range |
- Apply instance and run the application.
- See in runtime how the range filter is defined.
- Go to the EntityServices instance associated with the "Invoice" transaction.
- Go to the "InvoiceDate" filter and change the following properties:
- DateRangeType: "Semantic"
- IncludeManualOption: "True"
- DateRangeEmptyItem: "True"
- Semantic Date Range Set: "DaysPeriodsBackwards"
|
Semantic Date Range Set Selection |
- Apply instance and run the application.
- See in runtime how this filter works:
- Select each of the InvoiceDate combo options.
- See what happens when the user select the "Other" option (the "Other" option appears when "IncludeManualOption" is set to "True" in the semantic date filter)
- Return to the EntityServices pattern instance. Go to the "InvoiceDate" filter and change its semantic date range set to "CalendarPeriodPast".
- Apply instance and run the application.
- See how this semantic range set works.
Note: Semantic Date Range Sets can be customized by the developer, adding new date range sets or adding new options to a semantic date range set already defined. For more information go to this page.
|