Welcome to the nuBuilder Forums!

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

Select Field entries and field data display

Questions related to using nuBuilder Forte.
Post Reply
icoso
Posts: 181
Joined: Sun Feb 07, 2021 11:09 pm
Been thanked: 1 time

Select Field entries and field data display

Unread post by icoso »

I have a Selection Field (1st Year) that the user must select for new records. So on a new record this 1st year would be most likely the current year (2021). My current list of selections go from 2010 through 2025.
However this is a database in which I converted from a prior 3rd party database system has over 10,000's of records. Many of these records have a 1st year date PRIOR to 2010.

When I view a record in the Form for a record in which the 1st Year field has a year prior to 2010 it does not display. If I then duplicate this record, the 1st Year field does not duplicate over to the new record, so I end up with a record with a 1st Year field of 0.

Is there ANY WAY (without a lot of programming) to allow this field to display and copy the values prior to the 2010 that is in the selection list, WITHOUT adding in years to my selection list all the way back to the 1980's?

If not, what would you recommend as a way to "fix" this issue?
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Select Field entries and field data display

Unread post by kev1n »

icoso wrote:and copy the values prior to the 2010 that is in the selection list
What do you mean by that?
How about displaying those years in a separate object?
icoso
Posts: 181
Joined: Sun Feb 07, 2021 11:09 pm
Been thanked: 1 time

Re: Select Field entries and field data display

Unread post by icoso »

When I am looking at a record in a form view. I don't want to display a field in another field object. Doing so makes no sense at all. I have a single form that has a record displayed on it, name, address, city, etc... Current year, 1st year, etc... They are just regular fields on a form. If I click my duplicate function, I have it duplicate all fields except a few, (those don't matter). The 1st year field and current year fields are "selectable" fields. The Selection option list for both those fields shows 2010|2010|2011|2011....2025|2025.

When I converted all this original data, MANY of the records had a 1st year value prior to 2010, ie 1999. Therefore, it seems as if the NUB form will NOT display those field values in the 1st year field on the form since the value (1999) is not in the defined selection list. Because the value is not displayed, when I click my duplicate button to duplicate the record, that value(1999) that is actually in the record Im looking at but not displaying on the form, does not get duplicated to my new record.

1. Is there any way around this limitation of the form NOT displaying field values that are not in the selection list, even though the value of 1999 is in the database record?
2. (this question doesn't apply if the answer to 1 is no). Is there any way to copy/duplicate that field value even though the form is not displaying it because of the issue described above.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Select Field entries and field data display

Unread post by kev1n »

Using an additional object (e.g. year2_id) allows you to transfer its value to the year select like:

Code: Select all


var y = $("#year_id"); // visible select object, containing the year >= 20210
var y2 = $("#year2_id"); // hidden text object, containing the year, also prior to 2010

if (y.val() == '' && y2 != '') { // if the year is not displayed in the select but in the text object, add the year of the text object to select 2
  y.append($('<option>', { value: 1, text: $("#year2_id").val(), disabled : true, selected: true, hidden: true }))
}

When cloning the record, you might have to transfer the value again.
Post Reply