-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Recently I opened a case because the quick view is not working in some CDS definitions.
It seems that there are some requirements about a nullable fields and associations for UUID type:
quick views needs OData Referential Constraints to work. Referential Constraints are only added if specific rules are met. The nullability of the principal property, the dependent property and the navigation property needs to align as specified:
https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part3-csdl/odata-v4.0-errata03-os-part3-csdl-complete.html#_Toc453752543A navigation property is nullable = false if it has cardinality 1. It is nullable = true if it has cardinality 0..1.
If there is a association to another root entity, although you specify cardinality 1, it will get cardinality 0..1 due to draft handling.It is also import to know, that key fields are nullable = false. Non key fields are nullable = false except for UUID fields, these are also nullable = true due to technical implementation details.
To get the quick view working do not use UUID fields for the association conditions. In addition you might need to set the dependent field nullable = true with the annotation @Semantics.nullValueIndicatorFor.
@Semantics.nullValueIndicatorFor: 'OriginalField'
cast ('X' as boole_d) as NullValIndicator