cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (83,213)