Unusal behaviour

#1

I do not think this is a bug per se, but I can not figure out why the following happens.

Goal: select a record from a table , using primary key as an URL filter, display record in Modal body followed by a Form that submits an edit in the field. Upon success with the form submission, the modal updates to reflect the change in value, and closes. The source table is displayed and is updated.

What is occurring , is a value is changed and the new value is added or subtracted from a starting value creating a new total value. This is a calculated field in a MS SQL Server table. The process works, the value is added or subtracted and the new total is displayed in the table.

However when a new record is selected from the table, and does not have a total value, the modal displays the total value of the preceeding record.

As this probably makes little sense to anyone reading, the source table schema is as follows

Primary Key - identity
First Value-number-may not be null
Second Value -number, but can be null
Total Value - FirstValue+SecondValue

Because the Second Value is NULL until the a value is entered, the first instance of the Total Value is NULL
When a value is entered, the NULL is replaced and a numeric TotalValue is created.

Simply stated the data could look like this:

Primary Key First Value Second Value Total Value
1 10 20 30
2 20 30 50
3 30 NULL NULL

Selecting Record 1 or 2 will return, complete line of First, Second and Total Value
Selecting Record 3 returns, First Value, NULL and the TOTAL Value of Record 2 which in this example is 50, but could also be the last record that has a value in TOTAL.

Does anyone know why this occurs ? Other than enter a default value of 0 in Second Value, is there a method that works around this problem. ?

Not worth a lot of someone’s time, but I would appreciate any insight into this occurrence.

#2

I’m not sure I fully understand the problem you are having but I would try using a data detail region in your modal instead of a URL parameter.