Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

default id value when adding new record in browse table

Locked
ScottG
Posts: 6
Joined: Fri Nov 20, 2015 2:57 am

default id value when adding new record in browse table

Unread post by ScottG »

I have a table of say clients with client_id, clients_name, clients_add etc fields I have another table with visits with vis_id, vis_clientid, vis_date, vis_reason etc fields.

In my clients form when I select a client, I have a tab for client details then another tab for visits. In the visits tab I have a browse field with #RECORD_ID# filter to show only the visits to the selected client. You can then select any visit from the browse table and it opens a new window with the visit details, this all works fine,

When I select the "Add Record" button from the browse screen to add a new visit for that client, it opens the blank visit form in the same window as the browse field, but what I am looking to do is to default the vis_clientid field in the visit form to be the value of the selected Client_id. Thought that I could use #RECORD_ID# but of course this is blanked for a new record. Any suggestion on how I can do this
ScottG
Posts: 6
Joined: Fri Nov 20, 2015 2:57 am

Re: default id value when adding new record in browse table

Unread post by ScottG »

To hopefully explain it a bit better, using screenshots, its similar to the browse example in the wiki at http://wiki.nubuilder.net/nubuilderv3/i ... Browse_Tab but with the Outstanding Invoices tab having the default New Record button to add a new invoice for that customer and the New record form automatically coming up with the customers name already filled in.

I have tried using nuSetHash('ctempid', cid); within nuLoadBrowse() and
var cfid = nuGetHash('ctempid'); within nuLoadEdit()
but this doesnt work

So Any ideas of how to pass a field value from the browse screen to the Add New edit screen so that I can auto fill a field would be helpful
ScottG
Posts: 6
Joined: Fri Nov 20, 2015 2:57 am

Re: default id value when adding new record in browse table

Unread post by ScottG »

This thread can be closed now, got it working using #nu_browse_filter#
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: default id value when adding new record in browse table

Unread post by admin »

ScottG,

Thanks for letting me know.

Steven
Locked