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

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,537)