Adding New Records of Connected Tables

I want to check with the TB team and the community if I’m approaching and understanding this problem correctly, all feedback very much appreciated.

When I use this New Record Popup feature of a Datatable on it’s “parents” page.

A New Record appears to be unconnected to the Parent record until it’s saved. This seems totally logical as the record is entirely blank. However, frequently when I’m adding a new record I want the Page’s Form to limit functionality to the connected record from the parent or a related table.

At the moment, I’m opting to have a basic Add Form that simply has a Save Button on it.

saverecord

Now edit …

nowedit

When the “blank” record is saved I add record rules to add any other values I need present and then I prompt the user to Edit the table. The “blank” record now has the keys fields I want present so I can present related tables and info on the form.

I feel like I’m missing something or there are more elegant ways to achieve this.

Thanks for your time and and feedback you may have,

Graham.

1 Like

I have not understood why you don’t do edits and record rules in your pop-up. I might be missing something here.
But nice layout Graham!

on your add new form you can add ‘submit rule’ to ‘redirect to existing page’ and point to edit page. Keep your record rules as is and carryover to edit page to enable your filtering based on parent record like you are already doing.

This technique will take away need for user to be prompted to edit becuase the add new and edit is peformed in one transaction in the eyes of your end users.

Hi @Shumon thanks for the suggestion. I’d looked at this but the redirect to existing pages only appears to show me a subset of the pages I have and doesn’t include the page I want. I’d made an assumption it was by design but I’m going to open a ticket with support to see if it’s a bug…

I can only redirect to these pages from this page:

Although the app has many more pages…

Thanks again, I’ll let you know how I get on with this…

I still think TB should have a way that when you create a new record before displaying the form it’s already created all table joins already.

strange, the edit trailer page isnt listed. worth checking if it is sitting under a different layout or under another parent page beucase trainer edit is used twice. Also check if you saved it under a different name by mistake. Anyway, while waiting for the tb ticket response try this. Open the edit trailer page in user mode copy the url (or use the slug in design mode) then apply to page redirect but this time select ‘redirect to another website url’ …

Graham, you might be doing inline editing thats why theres no edit form. Press your orange button i want to see what happens. Your a highly skilled coder so you might prefer to use the local storage (local variable) option to achieve the same result. Im not a coder so all my suggestions are just low level logic. Video from Moe is attached for your info.

1 Like

Hi @Shumon, that’s one of those videos I need to watch a few times to fully understand what it’s doing and why. I get the basic principle of the local variable, I’ve not played with that option at all yet but I can see it might be useful in certain situations for sharing data on a Page when items are otherwise unaware of other elements that are on the page. Thanks for the pointer

me too, i also need to allocate time to go through the new custom components but no time. Im strugling with a tiny bit of js and also trying to do something possible: wrap the coin pic onto the group tabs.

Hi @Peter, thanks for your interest and comments :slight_smile:

What do you mean by “do edits”, I’m curious, I may have missed something…

I need the ability to “add” a new record, the record doesn’t yet exist so I’m presuming I can’t edit it.

Ideally, I’d like to be able to add a blank record so that the joins are in place to the related tables and then immediately edit the record.

This must be a common requirement so that’s why I’m thinking there might be a more elegant way of doing this. @Shumon 's suggestion is the idea I was also thinking but it’s still not ideal as the user has to click on the “save” button of the new record form and then get transferred to the edit page…

in this video I click on the Add New Record button, this Add Form has nothing on it other than a SAVE button and a submit rule which redirects to the Edit Screen. Ideally I’d like to get rid of the need to launch and display the Add screen but currently I need that to actually create the blank record (hope that makes sense) . If anyone has a better more elegant solution I’d love to hear from you.


Vidyard Recording

Vidyard Recording

MS Access db parent id on child form behavour evaluation. Its been few years but i thought i’d check your claim about the parent ID displaying on form load() and your right !! the ID is already known and is displayed in the tier 2 table.

the ideal table relationship design is a simple 3 tier company, department, employee. In tb however you get stuck on filtering tier 3 table unless you add another conection in tier 3 table to for company ID. I not going to comment on why tb needs that given MS Access and SQL Server dbs have always worked using design as shown.