Accessing the last record?
Hi,
I've been searching on how to access the last record of a View in a form. I've seen the code below. We are not expected to manually set a flag on the last record to search/filter on are we? Is there not a first, last, next, previous method of running through a list of records?
Cheers,
4. How can I create a view in Zoho Creator which shows only the current record?
To create a view which shows only the current record, Create 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 on add -> validate script as given below. The on add -> validate script is executed when a 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 on add
{
on validate
{
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
)
} Refer the sample application Show current record.