Skip to Content

CDS Associations with filters

May 30, 2017 at 01:33 PM


avatar image
Former Member

I have created two CDS views. One is header and other is Item. Defined a relationship between these two views using association. Created Odata service having navigation between header and item using @OData.publish:true. How to pass parameters in CDS Associations. Or how to pass filters in associations except on condition of associations.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sean Zhang
May 31, 2017 at 02:59 AM

Defining a filter in the on condition of the association will affect all the places which are using the association.

while if you want to have a one-time behavior, you could specify the filter or parameter where you're using it.

e.g. (imagine the _note is an association, )

// prefix parameter with colon
_note[ language = :langu ].text,

// prefix param with $parameters
_note[ language = $parameters.langu ].text,

// using filter
_note[ language = 'E' ].text

// specify the cardinality

_note[ 1:language = 'E' ].text

10 |10000 characters needed characters left characters exceeded