on 2021 Jun 10 11:37 AM
Hello all,
I am developing an application where I am using an Analyitical smart table. This table is annotated locally and now I want to add a criticality status to a field depending on a condition.
The cds view has no OData.publish annotation and it is used as data reference in the SEGW OData service.
My criticality field in the analytical cds view looks like this:
@DefaultAggregation: #SUM
manual_correction,
@DefaultAggregation: #SUM
summe,
case when summe > 100 then 1 else 3 end as criticality_1,
case when manual_correction < 100 then 3 else 1 end as criticality_2,
The annotations for those criticality values are used in the local annotation file as shown here:
This leads to the following result:
Summe shows the criticality state perfectly because there is a dataField with the value criticality_2 added to the lineItem. On the other hand, Manuelle Korrektur doesn't show any criticality state because there is no dataField with criticality_1 added to the lineItem (if I add it, it works as expected, like in the case of Summe field).
In both DataFields I have added the criticality bound with the path to the property. If I check the UI5 inspector, the DataField for Manuelle Korrektur shows that it has a property bound but with no value:
But for the Summe DataField, the property comes with a value:
If I check the lineItem model Information, I can see that no value is retrieved for criticality_1...
The funny/annoying thing is that if I switch to a TableType --> "Table", then everything works as expected... as shown below:
This makes no sense to me...
Therefore, my questions are:
How can I use this criticality field that I created in my analytical cds view inside my analytical smart table without having to add it as a dataField to the lineItem?
I don't want it to be shown, I just want it to be retrieved and applied as expected...
Is this a bug from the analytical table? Why does it work with Table and not with AnnalyticalTable (both smartTable)?
Thank you so much for your help.
Hey David,
This is one of the most infuriating Bugs I have experienced, especially working with grouping and aggregations, and that the behavior differs so much between table types. Thank you for your post highlighting this problem, it helped with my search for the error.
Long story short, the analytical Table seems to be the smartest (aggregations, grouping) but at the same time the dumbest (text associations, criticality) Table. What helped was setting the "RequestAtLeast" Property to the Fields you want to semantically load (text associations, criticality) in the annotations file. Seems like what the Table doesn't know, he won't show, at least in this regard.
<Annotation Term="UI.PresentationVariant">
<Record Type="UI.PresentationVariantType">
<PropertyValue Property="RequestAtLeast">
<Collection>
<PropertyPath>CriticalityField</PropertyPath>
<PropertyPath>TextAssociationField</PropertyPath>
</Collection>
</PropertyValue>
</Record>
</Annotation>
Hope this helps with your problem, it certainly helped mine.
Best Regards,
Christopher
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christopher,
Thanks for responding. I added the Annotation Criticality @Lineitem along with 2 fields as well.
Also exposed the criticality field via "RequestAtLeast" via presentation variant.
I can see the color @line item level but not in not at individual field level.
Attaching the snippet from Bindings in UI inspector for the field. As you can see the format is None.
Thanks,
Priyanka
Hi All,
I too have same issue even adding annotation "RequestedAtLeast" doesn't solve problem. As a workaround I had to use Criticality as default grouping or add criticality column in table. "RequestedAtLeast" annotation adds respective annotation in metadata still when GET request is triggered column for criticality is not fetched.
As Criticality is technical field, its not desirable to present this field to user using grouping or as a column.
Is there any other way to solve this issue?
lusine.stepanyan marcel.waechter Any clues ?
Thank You !!
@(UI.PresentationVariant #PostingItems: {
$Type : 'UI.PresentationVariantType',
Total : [AmountInTransactionCurrency],
Visualizations : ['@UI.LineItem#PostingItems', ],
RequestAtLeast : [
CriticalityItem,
hasErrorItem
],
InitialExpansionLevel: 1,
GroupBy : [CriticalityItem],
TotalBy : [Currency],
IncludeGrandTotal : true,
})
Hi Experts,
I've tried all the possible solutions mentioned here. I've tried adding the "request at least" fields, adding the grouping. Also tried changing the manifest for grid table type, or table type. No criticality comes into the UI .
This is how my CDS entity looks like
This is how my annotations file looks like
I even check the UI inspector, and the bindings are correct, they are coming with the correct values, so can anyone point me in the right direction to get the criticality?
Thanks in advance, kind regards.
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.