To create a view which shows only the current record,
- Add a hidden field in your form to identify the current record based on some value. For instance, let us create a hidden field named TXT with default value as "new". When a new record is submitted, the TXT field will hold the value "new"
- To update the TXT field of the previous record, with value as "old", write an Form Actions -> on add -> validate script as given below. The script will be executed when new form data is submitted. The script will fetch the record whose TXT value is "new" and update it with value as "old".
on add -> on validate script
if (count(Form1[TXT == "new"]) > 0)
{
dat = Form1 [TXT == "new"];
dat.TXT = "old";
}
- Create a view with criteria as [TXT == "new"] to display only the current record, as given below.
list "Current Record"
{
show all rows from Form1 [TXT == "new"]
(
Name
Number
City
)
}