Normal Topic Relational Database Subforms - Composite Key Field (Read 10727 times)
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Relational Database Subforms - Composite Key Field
Dec 30th, 2019 at 6:51pm
Print Post Print Post  
Hello, I was wondering if it was possible within Sesame to set multiple key fields for your relational databases within your main parent database? For example: I have a main database which is "Customers" then as a subform I have "Jobs". Within "Jobs" I have "Phases". Within "Phases" I have "Estimates", "Services", and "Payments". When I select a "Phase" subrecord. I would like to use the two key fields of "Job_ID" and "Phase_ID" as a composite key field. That will allow me to only see subrecords matching those two key fields. Anyone know if this is currently possible? Or should I just simplify?
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Relational Database Subforms - Composite Key Field
Reply #1 - Dec 30th, 2019 at 8:16pm
Print Post Print Post  
You'll need to make a field that combines those two values, something like Job_Phase_ID. It can be an invisible element that is filled with programming in the on Element change events of Job_ID and Phase_Id. Generally the multiple values are separated by a hyphen or an underscore.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: Relational Database Subforms - Composite Key Field
Reply #2 - Dec 31st, 2019 at 1:10pm
Print Post Print Post  
Will that work to display only the subrecords I want to display? For example. For Customer 1, Job has 3 records and, Phase has 6 records. When I select Job 2, I only want to display Phase 2-3, as those correspond to that actual job.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Relational Database Subforms - Composite Key Field
Reply #3 - Dec 31st, 2019 at 5:07pm
Print Post Print Post  
If Job and Phase are both unique numbers than yes that will work. If they are not unique numbers then your composite key will need to be something like Customer_ID-Job_ID-Phase_ID
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged