cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

key field is not enough in custom CDS view

liuteng15
Participant
0 Likes
1,212

What will happen if key field is not enough in custom CDS view, in other words,  if we just use key fields are taken from primary data source, don't add additional key fields, and  there are multiple rows that have the same key in preview of a custom CDS view, including CDS view, external API,etc.

We must define multiple keys in a custom CDS view to ensure unique identification  to every record?

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion
0 Likes

of course, you have to specify the key correctly to make the record unique.

cds  view preivew won't complain if the key is not unique, but the odata service will if I am not wrong.

liuteng15
Participant
0 Likes
Thanks. Is there a way to rapidly filter out CDS which doesn't have enough keys?
junwu
SAP Champion
SAP Champion
0 Likes
don't know what your real needs is. if just want to make it unique, use distinct in your cds view