Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Subform with non direct foreign key relationship

Questions related to using nuBuilder Forte.
Post Reply
stevedb
Posts: 21
Joined: Tue Oct 16, 2018 12:21 am

Subform with non direct foreign key relationship

Unread post by stevedb »

Hi,
Is there a way I can add a subform that does not have a direct relationship with the table used for the parent form?
I have a form in which I want a subform just to add rows to a database. The logic is along the lines of: I have hardware assemblies, assemblies have multiple revisions and at a particular revision there are multiple serialNumbers for things made to that revision.
So I have assembly, assemblyRevision and serialNumber tables.
I want to choose an assembly from a browse form (table assembly) to open an edit form for that assembly. On that form I want a subform (table serialNumber) where I can just add serial numbers along with their revision. I can populate the reference to assemblyRevision in the subform with javascript.
My serialNumber table does not contain any reference to the assembly table, just the assemblyRevision table.

I've basically got all this together - but I can't get it to work because by subform 'requires' a foreign key and I can't seem to disable this or put something in there that will make the UPDATE query work.

Hope this makes sense.

Cheers,
Steve
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Subform with non direct foreign key relationship

Unread post by Janusz »

maybe you can try to use iframe placed on the main edit form
If you like nuBuilder, please leave a review on SourceForge
stevedb
Posts: 21
Joined: Tue Oct 16, 2018 12:21 am

Re: Subform with non direct foreign key relationship

Unread post by stevedb »

I can't get iframes to allow me to add multlple rows to a table in the same way subforms does in grid mode.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Subform with non direct foreign key relationship

Unread post by admin »

stevedb,

1 - I would create a Form for assembly.

2 - Then create a Run Object (iFrame), on that Form, that displays all the matching assemblyRevision records.
This might help... https://www.youtube.com/watch?v=4ZRRVMlcc34

3 - Finally, I would create a Subform Object on the assemblyRevision Form that holds serialNumbers which relate to each assemblyRevision record.

That way you can start by selecting or adding an assembly record, add or edit assemblyRevisions (in the iFrame) and add serialNumbers to the correct assemblyRevisions via a Subform.


Steven
Post Reply