cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Meneghino
Level 10

Strange bahaviour in relation to CDS lookups and keys

It appears that CDS will only let you choose exactly one field as a key for any one custom entity, which is ok to start.

Then it also necessary that the key field is a required filed of the entity, this is logical.

However, I was able to set a field which is not unique as the key field, which is not logical.

Is this a bug?

 

Also, when I changed the key field, the foreign key of another custom entity that was looking up to this table did not change.

In other words the lookup filed still had the old text values of the old key and the lookup was broken, no warnings no nothing.

Is this intentional behaviour?

 

Many thanks and keep up the good work.

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff Vijeta
PowerApps Staff

Re: Strange bahaviour in relation to CDS lookups and keys

Hello DaveB,

 

Compound keys on custom entities are not yet supported. They are supported on standard entities.

 

Thanks

View solution in original post

3 REPLIES 3
DaveB
Level: Powered On

Re: Strange bahaviour in relation to CDS lookups and keys

When trying to create a compund key a timeout error is displayed:

 

EntityKey04s.jpg

 

If you refresh and go back the changes have not been saved. If you click the save button a second time a different error message displays:

 

EntityKey03s.jpg

 

Despite the encouragement to create a compund key with "Key Fields (?)", the message says this is not supported.

 

Please can you confirm whether or not compound keys are meant to be supported?

Community Support Team
Community Support Team

Re: Strange bahaviour in relation to CDS lookups and keys

Hi Meneghino,

 

I reproduced this issue, and I would collect and report this issue, thanks for your feedback.

 

@DaveB

 

I test with issue with two key fields and I get the message which says that “A valid primary key must contain only one field for custom entities”. With only one key field, it can be saved successfully. It seems that compound keys are not supported yet. I would try to confirm if there is an official document clarifying this issue.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PowerApps Staff Vijeta
PowerApps Staff

Re: Strange bahaviour in relation to CDS lookups and keys

Hello DaveB,

 

Compound keys on custom entities are not yet supported. They are supported on standard entities.

 

Thanks

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,586)