SAP-samples / fiori-elements-feature-showcase

Sample application that demonstrates and documents a broad variety of features of SAP Fiori elements for OData V4. Developers can play around with the new features and learn how to implement them.
https://community.sap.com/topics/fiori-elements
Apache License 2.0
198 stars 70 forks source link

Missing example for SearchRestrictions #7

Closed c-kobo closed 2 years ago

c-kobo commented 2 years ago

While there are examples for Capabilities annotations covering Crud Restrictions, I am missing an example for Capabilities.SearchRestrictions (e.g. hiding Search Field in OP table by annotating the entity used for it). I also couldn't find anything about this in the official documentation, so it would be great to have it at least mentioned in the feature showcase.

CAP CDS:

annotate <your service entity> with @(Capabilities : {
    SearchRestrictions : {
        $Type : 'Capabilities.SearchRestrictionsType',
        Searchable: true
    }
})

XML Annotation:

<Annotations Target="<your service entity">
  <Annotation Term="Capabilities.SearchRestrictions">
    <Record Type="Capabilities.SearchRestrictionsType">
    <PropertyValue Property="Searchable" Bool="false"/>
  </Record>
</Annotation>
schiwekM commented 2 years ago

Hi @c-kobo,

sounds like a good point. It will be part of an upcoming enhancement.

Best regards, Marten