Questions tagged [standardsetcontroller]

StandardSetController objects allow you to create list controllers similar to, or as extensions of, the pre-built Visualforce list controllers provided by Salesforce.

Filter by
Sorted by
Tagged with
13
votes
2answers
2k views

Any workaround for the bug with StandardSetController getSelected method?

I'm using a VF page and a controller to get the selected records in a view list and display some info. However the first time always fails (Related question), is there a different way to do this or a ...
11
votes
1answer
4k views

Lightning: Get list view records

How can one get ALL the records from a list view in a visualforce page running in Lightning? (Since no checkbox for selecting are available) Similar old question. With an adaptation from that ...
10
votes
2answers
3k views

How to call a standard controller action of a VF page from a VF component

I have a visual force page as follows which includes a component call Example one, Component has a command button and I want to call the standard controller save action of VF page from the VF ...
9
votes
1answer
7k views

StandardSetController List Instatiation and setFilterId

I'm having an issue using a List to instantiate the StandardSetController and applying a list view filter id. Here's an example of using a List for instantiation as detailed at http://www.salesforce....
8
votes
1answer
1k views

Is it possible to select individual records when using standardSetController in a custom controller

Background: I've been working on a dynamic contact search page modeled on Jeff Douglas 2010 post. It works, and now I am exploring ways to add pagination and the ability to select records and take ...
7
votes
1answer
745 views

Maximum stack depth reached: 1

According to salesforce doc : Total stack depth for any Apex invocation that recursively fires triggers due to insert, update, or delete statements is 16. But strangely for my case, I am getting ...
7
votes
1answer
645 views

Does StandardSetController.getRecord work correctly? If so, how do I use it?

So, I was experimenting with ways to reduce CPU usage, and I came across a strange scenario: the StandardSetController did not seem to use the "prototype" object the way it should (that is, at all). ...
6
votes
1answer
2k views

Can you use a ListView filter with a StandardSetController without a custom controller or extension?

I have a Visualforce page using a Standard Set Controller, and I'm trying to set the filter ID without using an element on the page and without using a customer controller or extension. Based on an ...
6
votes
1answer
1k views

Use StandardSetController for edit

I am trying to use the StandardSetController to update set of records. the code below was using StandardController to update just a single record. I want to use List for the Case object to iterate ...
6
votes
2answers
680 views

Losing StandardSetController selected records with first visit to VF page

I have a VF page that leverages a custom object's StandardSetController to compare records. I created a custom button to allow users to select records of that object from a related list and compare ...
5
votes
2answers
698 views

System.VisualforceException: Record set cannot be empty

I'm getting this error everytime I'm assigning a non empty list of sObject to a standardsetcontroller list<sObject> listSearchArticles = someOtherMethod(); // someOtherMethod returns a list of ...
5
votes
4answers
3k views

How to get total number of pages in a standardSetController extension class

I have visual force page which shows the related list. public ApexPages.StandardSetController setCon{ get{ if(setCon == null){ size = 5; string queryString = '...
5
votes
1answer
326 views

Woe Is the StandardSetController? Record set cannot be empty

I looked around for a duplicate for this issue, but couldn't find one. I created a very simple test on my way towards testing my extension. For those interested, SObjectFactory is on GitHub. This is ...
5
votes
1answer
410 views

Display bookmark link on detail page to inline VF page

How can I display an inline visualforce page on a page layout and have Salesforce generate the bookmark link at the top of the detail page, like it does for related lists? Currently, I can do this ...
4
votes
1answer
8k views

How to I get a test class working for a standardsetcontroller that bases off one record

I have a difficult issue because I have essentially a standardcontroller that runs off the current opportunity but it needs to be used via a relatedlist button on a custom object so it has to be a ...
4
votes
1answer
658 views

List controllers are not supported for Profile

Is there a workaround for "List controllers are not supported for Profile" error in visualforce page? Am creating a simple visualforce page to display the profiles in a data table with the pagination ...
4
votes
1answer
460 views

Change error displayed when wrong ID type is used with standard controller in visualforce

I have a VF page that uses standard controller account. I want to modify the error message that is displayed when I type the wrong id (invalid) in the URL to avoid getting a message like this: (I want ...
4
votes
1answer
2k views

Pagination using standardset controller and ability to remove rows from list

I have a list of accounts and i need to also have a ability to remove records from this list. Now this list sometimes gets in a lot of records which causes the page to reach the heap size limit. To ...
4
votes
2answers
2k views

Apply List Views to large pagination sets

I want to apply a list view to a standard set controller (only way to apply is a list view is the standard set controller) If the my query returns the maximum number of rows in a SOQL query: 10000 ...
3
votes
1answer
4k views

Pagination with Wrapper Class and StandardSetController

I have a requirement for which I've written some code for paginated wrapped records with checkboxes using standardsetcontroller. Now I want to display all paginated records with page buttons like (1.....
3
votes
1answer
2k views

Peculiar StandardSetController Issue with Test Class

Currently I have a test method that is proving to be quite difficult to test. I currently have a controller extentsion that is used for a custom list view button. The test code gets almost every ...
3
votes
1answer
688 views

Save Records in Salesforce using setcontroller

I am using salesforce standard set controller and displaying 4 records a page, I have input fields where i entering values and i wanted to save records on save button clicked. I want to create a ...
3
votes
2answers
239 views

Can a single VF page override both a standard action and a list action?

To minimize the complexity and number of distinct pages in my org I would like to use a single VF page to override both the standard Delete action and create a Delete list view action that allows a ...
3
votes
1answer
83 views

What exactly is the StandardSetController?

So I understand what it's used for and I know how to use it but, what exactly is it I create? Is it a List or an Array or what? When I build a StandardSetController in the following way public ...
3
votes
2answers
3k views

Help with Apex test class: Getting no code coverage

UPDATE: Sorry! I probably should have included this image to show how I would like the resulting VF page to appear. I'm new to MVC programming and the various controllers in Salesforce, so maybe a ...
3
votes
1answer
2k views

Setting filterId in ApexStandardSetController

I am trying to filter the records based on the selected list view in batch apex. But it fetches all the records and does not apply the filter even though i have used setFilterId String query ='...
3
votes
1answer
54 views

Filter Id value 00BXXXXXXXXXXXX is not valid for the Task standard controller

Ok so I ran into something interesting today when trying to create a Visualforce button for the Task object. Everything was working gravy in Lightning. I was able to select records and everything ...
3
votes
1answer
3k views

The CORRECT way to redirect to a ListView from StandardSetController?

From a List Button or Visualforce Page, I wanna redirect to a ListView after. Common, right? Life is great when we're dealing with Standard Controller: using view() method. What is the correct, ...
3
votes
1answer
6k views

custom list view that allows new filter parameters

I'm looking to create a VF page with a list of records and dynamic filter criteria. The user needs to be able to filter the records based on various criteria and also save those filters for future use....
3
votes
1answer
638 views

pagination not working using standardsetcontroller

I am using standardsetcontroller for pagination. But it's not working properly. It's showing previous, next buttons correctly but records showing all the records, not shown what given in set.pageSize ...
3
votes
1answer
971 views

List View Visibility

I have a page where I am trying to show which ListViews a Project is in. I can get the data I want in the Developer Console by querying ListView. However, when I try to import the following query to ...
2
votes
1answer
1k views

Accessing the StandardSetController from a Lightning component

I'm using a StandardSetController to grab all the ListViews for the logged-in user and displaying them in a Lightning component. When I call the method via anonymous Apex, it works fine, but when I ...
2
votes
1answer
1k views

Unable To Cover StandardSetController.getSelected Loop

I cant seem to figure out why the creation of this custom object is not getting hit by my test class. Any help would be greatly appreciated. Here is the test class: @isTest public class ...
2
votes
1answer
255 views

Cross Site Scripting issue

I am getting XSS issue for the following statements in my code : a. lstDisplay.add(new SelectOption('','--None--')); b. lstDisplay.add(new SelectOption(selectOptionObj.getValue(),selectOptionObj....
2
votes
1answer
121 views

How should I write and structure a good Apex Page Extension Test method?

I'm on the Advanced Apex Specialist Superbadge step 8 and I'm writing the test class, but what they are asking for seems different from what I've been taught about test methods. I thought that I ...
2
votes
1answer
485 views

StandardSetController Test Class - 'Constructor not defined'

I am trying to write a test class for a StandardSetController with a very simple extension that processes a list of records that were selected from a related list. I am coming up short on how to get ...
2
votes
2answers
1k views

Content cannot be displayed: Too many query locator rows: 10001

How to show a message/convey to the user that there are more than 10000 records when using StandardSetController? Do I need to fire a separate SOQL just to count the number of rows and use the LIMT ...
2
votes
2answers
557 views

StandardSetControllers Save Not Working

The save method on the StandardSetController is not working as I expect. I have a controller to update a list of custom objects. I have a vf page with a text box for the update and a Submit button to ...
2
votes
2answers
7k views

Standardsetcontroller methods first(),last(),next() and previous() not working

Hi I am trying to implement sorting and pagination in visualforce. I am using the standardsetcontroller but for some reason the standardsetcontroller methods do not fire the actions when clicked on. ...
2
votes
2answers
1k views

Passing Quote list to StandardSetController, not grabbing quote ID and returns null

QuoteLineItem tempQLI = [SELECT QuoteID FROM QuoteLineItem WHERE Discountable__c='YES' Limit 1]; String quoteId = tempQLI.quoteId; Quote newtestQuote = [SELECT ID ...
2
votes
1answer
537 views

Query based on the Listview filter and the account id

The visualforce which we are working now shows the list of opportunities based on the account Id in the query string parameter. So we are using the standard set controller for the list view filtering, ...
2
votes
1answer
328 views

Run a standard set controller extension from execute anonymous

I am trying to run a standard set controller extension from execute anonymous for the purpose of debugging, however I keep getting "Internal Salesforce.com error". I have narrowed down the offending ...
2
votes
2answers
9k views

Visualforce page for multiple record creation

I want a VF page that would aid creating multiple child records for selected IDs. As an example, I would start from Account, select 5 or 7 Contacts, click a button which would take me to a custom VF ...
2
votes
1answer
351 views

Pagination is not working for my VF page

I have search page where it will search for Opportunities based on some filters. I added pagination,but the issue is it is showing only 10 records out of 125 records and when I click on next button it ...
2
votes
1answer
980 views

StandardSetController.getRecords() is returning unrelated records

In an VisualForce page I am using a standardController on the Quote object. I also have an extension that has a constructor that takes in a standardSetController. The standardSetController.getRecords()...
2
votes
2answers
926 views

list of records via custom controller

I'm using following simple code to get list of Account via custom controller but it is not returning records.what I'm doing wrong ? <apex:page controller="listcontroller" > <apex:Form > ...
2
votes
1answer
995 views

Visualforce dynamic binding

I have this page: <apex:page controller="mycontroller"> <apex:pageBlock > <apex:pageblocktable value="{!sc2.records}" var="test"> <!--<apex:pageblocktable ...
2
votes
1answer
425 views

Using StandardSetController in APEX Web Service

I have created an APEX REST web service and tried to use StandardSetController in order to retrieve objects for some list view. My idea was to use this built in list view functionality for objects ...
2
votes
2answers
438 views

Check whether an object is in a standardsetcontroller

If I have a StandardSetController and an object ID, is there a way to check whether the object would be included in the StandardSetController, short of looping through all of its objects? Best ...
2
votes
0answers
189 views

How does the standard set controller manage state?

I have a VF datatable, where the user needs to update some fields on each record, and there can be thousands (though less than 10k). I learned that I could do that with the StandardSetController, and ...