How to use a Single Page for both Edit and Add features

I have a just finished creating my edit page for my transport “Job” records. This edit screen includes many related tables and is quite sophisticated in it’s design. Now that this Edit screen is complete, I’ve turned my attention to the Job Add page. Rather that recreate the page again with all it’s components, logic etc and duplicate code, I thought a better approach might be to have some javascript that just creates a blank Job record and immediately opens it in the existing edit Page.

I’m wondering if this approach is something that anyone else has done and how they might have achieved that.

In some other database tools I’ve used in the past (Microsoft Access for example) I’d just have a single page design that accomplished both edit and add functionality so I’m trying to reproduce that concept.

Any feedback or ideas would be very welcome.

Hi Greddie,

Inside the edit page of ‘Jobs’ you can add another form component to add new job record but then you’ll still be left with the current job record and its related record in the rest of edit the form, which is no good. The other options are to create new job record using normal process then copy and past some of the components from edit form to add new form. Also you can try and a record rule to edit save button to add new record with custom records name. but still these ideas only get you half way. sorry.

Hey @Shumon thanks for your thoughts. The Copy and Paste option is quite limited as you can’t paste Page components currently into anything other than a top level Page. Given this is probably quite a common scenario I’m sure someone must have tried achieving it in the manner I described…

Create a new record (with no data other than the key record field) - then immediately open that in the edit the page.

Duplication is something that should only really be done as a last resort, although often necessary in low code platforms.

I think I’ll look into the option of a Button launching javascript that creates a new record and then see if it’s possible to pop up the edit page of that newly created record. @Chem @tim.young have you guys ever done this, is it possible?

Graham.

@GREDDIE I have implemented two similar things that may be helpful as starting points.

  1. Here is a tutorial I wrote for creating a new item via button placed anywhere (there is a link to an example app in there as well)
  2. I solved another issue by tweaking this code a little to create “tabs” in a modal, like steps. You could use the first tab as your edit page, and then put a form to add a new job record on the second tab (If I’m reading the workflow correctly)


modal_tab

Hi @james I really appreciate you taking the time to post this, sorry for not replying sooner. As you say, both of these methods are on similar tracks.

My requirements are a little different (I think) but sadly due to my lack of technical understanding of the code examples I’m not able to determine if I can repurpose any of it for my needs.

Just to recap, my intention is to not create a new ADD Page and to re-use the existing EDIT page when users want to add records.

I wondered if that anyone had created a button with code behind it that would essentially

a) Add a blank record to the database and then immediately…
b) Open that blank record in the EDIT Page rending the need for a separate ADD screen redundant.

Sometimes due to my lack of technical understanding I’m trying to achieve things that are possibly not technically possible (or easily achievable). I find this gap of knowledge my biggest issue when building with Tadabase as I find myself spending literally days researching and trial and error trying to establish how I might be able to do something.

If you or anyone out there is interested in quoting for such functionality I’d be interested to hear from them.

Kind regards,
Graham

@GREDDIE I don’t know if it’s possible to have two actions: (1) create new record; and (2) popup edit page occur with a single user input (or if it is, I don’t know how).

You can, however, use an action button to create a new blank record in a table, then click on it to open it in your edit popup. The key to making it “user friendly” would be to have a small js script to refresh the table automatically so it is visible upon creation.

Does that help?

try redirecting to edit page once new record has been created.

HI @james sorry I missed this reply somehow, thanks for your suggestion. Potentially that could be an option. This action button though, where would it be initiated from, outside of the table because it can’t be on the row of course as there is no record.

At the moment I’m working on a solution that works like this. 1) Add record, 2) User immediately Saves record, 3) redirects to Edit Page. However due a limitation* in the feature “Redirect to Existing Page” I haven’t quite got this working correctly yet.

Something like this:


Vidyard Recording

Vidyard Recording

*Limitation of Pages you can redirect to…
Tadabase Support : " The submission rule drop-down is only going to show Parent level pages, as well as Child level Details Pages for the relevant data table. Please note that if your Details Page is more than 1 level down from the Parent (ie. Jobs → Job Details → Task Details), this will not appear as an option."

@GREDDIE I just started using custom elements to get around page redirect limitations. The other benefit of custom elements is that you can make the whole row clickable and use a custom link for the popup. This also allows me use one single details page for each table and link to it from anywhere in the database.

I just used a details section and added an Action button on the left which creates a new connected item. The only part I haven’t gotten to is the JavaScript to refresh the table automatically once the new record is added. In the video you’ll see me refresh the page manually.


1 Like

@james I like what you’ve done there, it’s a nice layout and I can see that’s going to give you a lot of scope going forward.

I’ve only played with a simple single custom component so far, you’ve got a lot further than I have so it looks a little daunting right now to implement this across my app (I’ve been working on it for 5 months of my life :slight_smile: )

TB is fantastic and infuriating at the same time, usually I’m more furious at myself for not knowing how to overcome an obstacle as usually there is a way to do anything. Please update this post as you progress as your approach may be way to go for sure. I’ve discussed this general issue with @tim.young too and he gave me the impression that the issue is common and that it’s high up on their agenda to review and find a better solution. In the mean time I’m going to plough-on with other areas of my app and circle back periodically to see what progress may have been made by them, yourself and the community. Thanks again for the post, it’s very interesting.

@GREDDIE When I started building this app 10 months ago, I was a “no-coder” as well. Since then, I’ve relied on Google, Stack Exchange, and lots of coffee to figure it all out.

2 Likes

Graham,

Is your application multi-tenant or just for one company?

Just one company (our own actually so I have a lot of scope with regards to how things can be which is great).

Ok nice, for every transaction, might be worth adding DateStamp, User, Company… just incase, you might need this later on. for example if ever you need to extend user group to include upstream/downstream processes in the logistics supply chain.

The front end looks like it is built for extra wide curved screen. Mobile phone/Tablet view?

My app is to replace an existing MS Access application…

…so trying to keep it similar for the existing users. This screen is only ever going to be used in an office and you’re right it’s displayed on 3 monitors for each user ! :slight_smile:

Other screens will be designed specifically for mobile access later …