Page 1 of 1

Best Approach for Creating Subforms in nuBuilder

Posted: Mon Jan 13, 2025 5:25 pm
by yvesf
Dear All,

In nuBuilder, it's possible to create multiple forms for the same table, which allows for different ways to update the same data. Regarding subforms, I see two approaches:

Create a subform directly with a primary-foreign key relationship, which links it to the parent form.
Create a browse/edit form first and then transform it into a subform. This doesn’t require a primary-foreign key.
What is the recommended approach for flexibility and ease of use? Should we create subforms directly or start with a browse/edit form and later convert it into a subform?

Thank you for your guidance.

Best regards,

Yves

Re: Best Approach for Creating Subforms in nuBuilder

Posted: Mon Jan 13, 2025 6:06 pm
by steven
Hi Yves,

Can you explain your goal a bit more - what are the tables you want to create and why do they need to be linked?


Steven

Re: Best Approach for Creating Subforms in nuBuilder

Posted: Tue Jan 14, 2025 10:03 am
by yvesf
Hello Steven,

I want to build a solution in nuBuilder that:

Lists related doctors for each patient in a 1-to-many relationship (each patient can have multiple doctors).
Allows creating doctors from two places:
- Directly within the Patient form (e.g., inline in a subform ).
- Independently via a separate Doctor form, accessible through a "Doctor" button.
My goal is to manage this relationship efficiently while ensuring a seamless way to create and list doctors for each patient.
What is the best way to do that with nubuilder ?
Yves

Re: Best Approach for Creating Subforms in nuBuilder

Posted: Tue Jan 14, 2025 1:29 pm
by steven
Yves,

I would create 3 tables.

1. doctor (whos ID is doctor_id) + other fields
2. patient (whos ID is patient_id) + other fields
3. doctor_patient with 3 fields (for the subform)...

doctor_patient_id - The Primary Key

dop_patient_id - The Foreign Key for the Subform

dop_doctor_id - if you use a Lookup Object for this ID you will be able to add Doctors on the fly.


Steven