Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Search Objects for New Records
-
- Posts: 19
- Joined: Fri Mar 22, 2024 4:59 pm
Search Objects for New Records
Greetings,
I have a browse form which takes me to its associated edit form for a new record when I press the Add button.
On the edit form I have several select objects both of type 'Select' and 'Input: Select'.
All of these are based on select statements that work when existing records are edited but produce no results for new records and hence empty select lists.
How is this so? Am I missing something?
Cheers,
Alan
I have a browse form which takes me to its associated edit form for a new record when I press the Add button.
On the edit form I have several select objects both of type 'Select' and 'Input: Select'.
All of these are based on select statements that work when existing records are edited but produce no results for new records and hence empty select lists.
How is this so? Am I missing something?
Cheers,
Alan
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Search Objects for New Records
Hi,
Do you use Hash Cookies in the SQL / can you post an example of an SQL here?
Do you use Hash Cookies in the SQL / can you post an example of an SQL here?
-
- Posts: 19
- Joined: Fri Mar 22, 2024 4:59 pm
Re: Search Objects for New Records
Here's the SQL:
select distinct timepoint
from StudyTimepoint
where timepoint is not null
order by timepoint
No hash cookies in sight!
select distinct timepoint
from StudyTimepoint
where timepoint is not null
order by timepoint
No hash cookies in sight!
-
- Posts: 19
- Joined: Fri Mar 22, 2024 4:59 pm
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Search Objects for New Records
The SQL must return 2 column, not 1 (See wiki)
If the display and the bound value are identical, use
If the display and the bound value are identical, use
Code: Select all
select distinct timepoint, timepoint
from StudyTimepoint
where timepoint is not null
order by timepoint
-
- Posts: 19
- Joined: Fri Mar 22, 2024 4:59 pm
Re: Search Objects for New Records
Unfortunately this doesn't work either.
It must be something else as it works when editing records.
I've even stripped down the SQL statement to:
select 'test' as study, 'test' as study
It must be something else as it works when editing records.
I've even stripped down the SQL statement to:
select 'test' as study, 'test' as study
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Search Objects for New Records
I can't replicate the issue on my end. However, it's possible that the problem stems from another issue within the form.
Please check nuDebug Results, the server log, and the developer console for any errors.
Does the issue also occur if you create a completely new form with only one single select object on it?
Please check nuDebug Results, the server log, and the developer console for any errors.
Does the issue also occur if you create a completely new form with only one single select object on it?
-
- Posts: 19
- Joined: Fri Mar 22, 2024 4:59 pm
-
- Posts: 19
- Joined: Fri Mar 22, 2024 4:59 pm
Re: Search Objects for New Records
Hi Kevin,
Looking in the debug results it turns out that another sql statement in another tab had errors due to an undefined hash variable when a new record is displayed. So I've made sure that all hash variables have default values so that no errors are produced and now the list boxes are correctly populated.
In doing this however I'm finding that I'm unable to set the default value of a lookup object. I've tried the methods outlined here:
https://github.com/nuBuilder/nuBuilder- ... ault_value
but to no avail. Can default values for lookup objects be set?
Thanks for pointing me in the right direction!
Cheers,
Alan
Looking in the debug results it turns out that another sql statement in another tab had errors due to an undefined hash variable when a new record is displayed. So I've made sure that all hash variables have default values so that no errors are produced and now the list boxes are correctly populated.
In doing this however I'm finding that I'm unable to set the default value of a lookup object. I've tried the methods outlined here:
https://github.com/nuBuilder/nuBuilder- ... ault_value
but to no avail. Can default values for lookup objects be set?
Thanks for pointing me in the right direction!
Cheers,
Alan