foo_yk
Apprentice

How to display only the latest result instead of all result in a list view

Jump to solution

Dear all,

 

I have a list view, but it is showing all the record. How to display only the latest result instead of all result in a list view?

 

My user only need to see the latest result instead of all.

 

Thank you.

0 Kudos
Reply
5 Replies
MickiC
Apprentice

Re: How to display only the latest result instead of all result in a list view

Jump to solution

Assuming your data has a collumn that can be used to sort and filter you can use the form rules. In the "View Execute intialize" rule for the form it will be calling the smartobject associated with the list. Usually "then execute the list method" Click configure. You will see 5 tabs

1) Input mappings - can be used to get only the newest data

2) Filter - can be used to filter resultd, filter different than inout in that you have more operators (input is just equal to)

3) Output mappings - puts the data in the fields

4) Sort - will allow you to sort the data by one or more columns

 

I hope this helps

0 Kudos
Reply
foo_yk
Apprentice

Re: How to display only the latest result instead of all result in a list view

Jump to solution

Hi MicKiC,

 

Thank you for your reply.

 

I had did something as below:

1. Enable paging for the list view with display 1 item per page.

2. When the form initialize, perform getlist for this view and sort the date creation descending.

 

So the list view will only display the latest result. But when user click on next in the paging, they can see older result.

 

Thank you.

 

 

0 Kudos
Reply
Kran
Apprentice

Re: How to display only the latest result instead of all result in a list view

Jump to solution

Hi foo_yk,

 

To hide footer you can use javscript or Jquery on  div having class "Grid-footer" of this Grid.

 

Example: 

 

<script>$(document).ready(function() {$('.grid-footer').css('display','none');});</script>

 

 

 

0 Kudos
Reply
steveh
Novice

Re: How to display only the latest result instead of all result in a list view

Jump to solution

Not sure why you would use a list view if you know ahead of time you only want to display 1 record.  If you switch to an item view, you can call GetList on a SmartObject an it will retrieve the "first" record.  The "first" record takes into consideration any sorting you specified in the GetList call.  If you need the most recent entry and can do an appropriate descending sort, you should get the record you need.

 

 

0 Kudos
Reply
B5A7
Scholar

Re: How to display only the latest result instead of all result in a list view

Jump to solution
Thanks Steve. Worked well.
0 Kudos
Reply