cancel
Showing results for 
Search instead for 
Did you mean: 

Semantic Date Range on Filter Bar using oData V4

kachin_agarwal
Explorer

Hi All,

I have created a fiori elements app using a CAP module that exposes an oData v4 service. I am trying to enable the semantic date range in the filterbar. I tried following the below documentation for enabling for v4 service.

https://sapui5.hana.ondemand.com/#/topic/fef65d03d01a4b2baca28983a5449cf7

added - "@com.sap.vocabularies.UI.v1.SelectionFields":{"useSemanticDateRange":false}" in my manifest.json file.

But still i am unable to see the change in the UI.

Is there any other cds annotation that has to be added in my CAP module.

Thanks,

Kachin

View Entire Topic
former_member750716
Discoverer

Hi Kachin,

To enable semantic date range in the filter bar we have to follow below steps.

Manifest settings:

"@com.sap.vocabularies.UI.v1.SelectionFields": {"useSemanticDateRange":true}

Field should be single range date field(cds change):

FilterRestrictions : {

FilterExpressionRestrictions : [{

Property : 'SalesOrderDate',

AllowedExpressions: 'SingleRange'

}]

}

Field type should be Edm.Date:

SalesOrderDate : Date @(Common : {Label : 'Document Date'});

Could you please try this and let us know if is working...

Thanks and Regards,

Senthil

kachin_agarwal
Explorer

Thanks Senthilkumar. It worked!