function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Swiderski, ErikSwiderski, Erik 

List view in visualforce page

Hi Folks, I'm trying to create a visualforce page that is a list view of records (from another object) that are related to the parent object. The reason why I'm going the route of a visualforce page rather than the standard related list, is I would like users to be able to inline edit a field on the related record without navigating off the record detail page of the parent. I was able to get the list view into a visualforce page with inline editing working, but missing a few pieces to polish this up.

Is there a way I can specify which list view to show on the visualforce page and have it stick? If I go to the object and choose another listview from the drop down list, that listview shows on the visualforce page. Also, how do I specify a filter in the list view to only show records related to the parent?
KC ShaferKC Shafer
Can you perhaps show a screen shot and code to get a better sense of what you are trying to do? It sounds like you are creating a visualforce page, that you want to display inline in a page layout, is that correct?

Is there a way I can specify which list view to show on the visualforce page and have it stick? Is something not staying on the record page or the visualforce page that you want, can you be more specific what is happening, what drop down list are you referring too.


 Also, how do I specify a filter in the list view to only show records related to the parent? This one can have a variety of approaches, the end goal here is allow the user to filter the query. Obviously they aren't going to modify the query for the related records directly, so you need to abstract that too them. It really depends on what kind of filter you are talking about, a date toggle for example could be done with a commandButton, while a filter by user could be done with a select list. Than you transmit those values back to the controller, and use them generate a new query with the appropriate filters. Those are very generalized solutions, but is the basic approach to allow user input to filter query results.

--KC

 
Swiderski, ErikSwiderski, Erik
Here is the list view:
User-added image

Here is the list view on a visualforce page (and that visual force page is on the record detail layout):
User-added image

And here is the visualforce page code I'm currently working with:
User-added image

I know that the list view is currently blank, but I need the list view to populate records that are related to the record that the page is embedded on.

Also, on the first image, if I browse to the object and change the drop down to another list view, the list view on the visualforce page changes to the last one I viewed directly from the object.

I also need the list view to be inline editable :-)