cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nikil
Frequent Visitor

How to create relationship between custom tables in CDM

Hello

I have created two custom tables in CDM, item and item category. I want to create a relationship between these tables. I added Item Category field in Item table and picked data type as a Picklist. However in the properties pane's Picklist drop down, I do not find the custom Item Category table I have created.

 

Please advice.

 

Regards 

1 ACCEPTED SOLUTION

Accepted Solutions
DaveB
Advocate II
Advocate II

Lookup's are history in CDS databases created in new environments. Now you manage relationships when designing an Entity.

EntityRelationships01.jpg

The screen shot shows Item - ItemCategory.

If you work with a legacy CDM database in a migrated environment it still has Lookup's.

Dave

View solution in original post

7 REPLIES 7
DaveB
Advocate II
Advocate II

Lookup's are history in CDS databases created in new environments. Now you manage relationships when designing an Entity.

EntityRelationships01.jpg

The screen shot shows Item - ItemCategory.

If you work with a legacy CDM database in a migrated environment it still has Lookup's.

Dave

View solution in original post

nikil
Frequent Visitor

Thanks!

Thank you very much for your response. I did create the relationship as indicated. However, I do not know how to manage the keys (primary & foreign key). Is there a step by step process to relate keys the keys? 

 

Thanks, 

Isaiah A.

You drag-n-drop / delete fields to compose the entity key in the Keys tab...

 

EntityKey01.jpg

Sorry, it appears I am not making myself clear. Let me explain it further. Suppose I have an entity called "Title" with TitleID as my primary key. And I have another entity called Employee, which has is own primary key (EmployeeID), and a another column called TitleID. "Title" is the primary table and "Employee" is the secondary table. How do I relate Employee.TitleID with Title.TitleID in a one-to-many relationship? 

 

Thanks,

Isaiah. 

I have only discovered how to create 1-to-many lookup relationships.

#1 Make field 'TitleID' of Title entity the key

#2 For Employee entity create a relationship to Title entity and call it 'EmployeeTitleID'.

 

In #2 it creates a new extra field to support the relationship, the original 'Employee.TitleID' field is not used. I cannot see any way to reuse this field in the new CDS databases.

Hello IsaiahA,

 

When you create a relation from a child entity to a parent entity you are creating a 1:n relationship. We automatically create a lookup field on child entity and relate it with the primary key of the parent entity.

 

Thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (67,763)