on 2023 Mar 07 3:16 PM
In my fiori elements list report app I am using the following annotation to add a filter lbkum !== 0 as a de fault value. It is not working:
<Annotations Target="SAP.EntitySet">
<Annotation Term="UI.SelectionVariant">
<Record>
<PropertyValue Property="SelectOptions">
<Collection>
<Record Type="UI.SelectOptionType">
<PropertyValue Property="Ranges">
<Collection>
<Record Type="UI.SelectionRangeType">
<PropertyValue Property="Option" EnumMember="UI.SelectionRangeOptionType/NE"/>
<PropertyValue Property="Low" Decimal="0.000"/>
<PropertyValue Property="Sign" EnumMember="UI.SelectionRangeSignType/I"/>
</Record>
</Collection>
</PropertyValue>
<PropertyValue Property="PropertyName" PropertyPath="lbkum"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations><br>
When I use the following annotations to set a default filter value salk3 === 0, it works:
<Annotations Target="SAP.EntitySet/lbkum"><br> <Annotation Term="Common.FilterDefaultValue" Decimal="0.000"/>
</Annotations><br>
I am developing this on Business Application studio. Do I need to deploy this to a proper launchpad to see the default filter? What is missing here?
Thanks.
From what I can see, this should work. You do not need to deploy it to the launchpad in order to see the annotations. Try the below steps
1. Check the name of your entity set, make sure it is the specified Target attribute
2. Check the name of the property, make sure the PropertyPath specifies in the PropertyName attribute is correct
3. Check the data type - make sure the Decimal attribute matches the data type of the property
4. Check if there are any other annotations overriding the default filter
If none of the above works, you can debug the issue by checking the metadata of the service using the below URL to see if the annotations are correctly applied.
/{serivceRoot}/$metadata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks for the reply.
The annotations were added using the guided development generator in BAS to the local annotations.xml file, and the entity, the name of the property and the type are all correct, as checked in the metadata file. There are no annotations other than the following:
<Annotations Target="ServiceName.EntitySet">
<Annotation Term="UI.LineItem">
<Collection>
...
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="lbkum"/>
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="salk3"/>
</Record>
...
</Collection>
</Annotation>
<Annotation Term="UI.SelectionFields">
<Collection>
...
<PropertyPath>lbkum</PropertyPath>
...
</Collection>
</Annotation>
</Annotations>
When I debugged in javascript, particularly in the MetadataAnalyzer.js file, I found that the annotation is indeed being recognized, it's just not being taken into account. Here is (part of ) the return of the function _getEntityDefinition of the mentioned class:
I am out of ideas..
Thanks gain for any help.
It is unfortunately not supported according to the documentation:
https://sapui5.hana.ondemand.com/sdk/#/topic/f27ad7bc1f9c4b0d947b1fb18c37e94c.html
Hello All,
If someone is still searching for a solution, you need to define the annotation in the manifest file. This worked for me:
Described here:
https://sapui5.hana.ondemand.com/sdk/#/topic/49a6ba5b8d6946208322a9f7e16837c2
Regards,
Bettina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.