on 03-07-2023 3:35 PM
Hi Experts,
I have created a List Report application based on a CAP OData V4 service.
The problem I am facing is when I try to use Search List report with Date/TimeStamp my application is not getting filtered.
My entity looks like below:
entity Books: managed{
key ID: String,
name:String
}
So now when I try to perform search on createdAt, modifiedAt fields (which are timestamps from managed aspect) I am not able to filter the data.
Is there any annotation that I need to use to enable the search functionality for the fields createdAt, modifiedAt.
If I search other fields, I am able to get the data. But for Timestamp fields I am not getting the data .
In my application Date is getting displayed like below
Do let me know if any annotation needs to be implemented for this.
With Regards,
Partha.
By default, the search is limited to elements of type String, excluding calculated or virtual elements. This is to improve the performance of search queries by default by favoring performance over convenience.
https://cap.cloud.sap/docs/guides/providing-services#using-cds-search-annotation
To include or exclude elements from the set of searchable elements in search queries, you can use the @cds.search entity-level annotation. For example:
@cds.search: { ID, name, createdAt, modifiedAt }
entity Books : managed {
key ID: String;
name: String;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
11 | |
10 | |
8 | |
8 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.