This topic is locked

View on List page the latest updated field only

3/7/2014 7:01:33 AM
PHPRunner General questions
C
chrispa author

hi i need some help
i have a list page where user can copy a record make a change and by pressing "save" i have a field "Date" that gets the current date .

what i need is that on list page to view / show only the latest updated record and not the previous ones .
some how to hide the previous records of same item and keep the latest one.
is that possibly thanks

Sergey Kornilov admin 3/7/2014

It's not easy but possible.
Somehow you need to mark those old records in inactive. Add a new field to this table named Status. When new record is created set the value of Status field to 'active'. At the same time update the previous copy of this record setting Status field to 'inactive'. You can do that in AfterAdd or BeforeAdd event.
Now you can modify the SQL query of this table adding the following WHERE clause at the end:

WHERE status='active'


This is it.