Skip to main content
7 votes

VF compile error: standardsetController - void.Id

Your issue is you are using quotes in two places for two conflicting use cases As RecordsetVar ​<apex:page controller="QuotePageController" recordSetVar="quotes"> As Getter in controller ...
cropredy's user avatar
  • 71.9k
6 votes
Accepted

Unable To Cover StandardSetController.getSelected Loop

You never set the selected records. Break out your controller and extension constructors so you can do so. ApexPages.StandardSetController controller = new ApexPages.StandardSetController(cases); ...
Adrian Larson's user avatar
  • 150k
6 votes

Accessing the StandardSetController from a Lightning component

ApexPages.StandardSetController is designed to be run in the context of Visualforce and not Lightning Experience or async contexts (e.g. batchable, queueable, futures). To get list view options, I ...
Doug Ayers's user avatar
  • 4,196
6 votes
Accepted

Possible to redirect to a page that uses standardSetController from another Visualforce page?

You can't redirect in Apex, because redirects require PageReference, and PageReference doesn't support having a single query string key with multiple values. However, you can do this in JavaScript by ...
sfdcfox's user avatar
  • 495k
5 votes
Accepted

StandardSetController - how does it work?

The StandardSetController uses a database cursor to paginate through the results. Unlike using LIMIT+OFFSET, this method supports 10,000 rows of data, the results will not change each time a new page ...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

Maximum stack depth reached: 1

Got it to work. In fact nothing to do with DML etc. It was related to duplicate variable usage. In my VF page my recordsetvar had the same name as a variable in my class : Page : <apex:page ...
vanessen's user avatar
  • 2,705
4 votes
Accepted

What exactly is the StandardSetController?

StandardSetController can be created one of two ways, one being from a List<SObject>, and one being from a Database.QueryLocator. If you use the first form, it creates an internal backing array ...
sfdcfox's user avatar
  • 495k
4 votes
Accepted

Exception thrown by StandardSetController with Database.getQueryLocator?

There is no need for a try-catch block your code, because there is nothing you can catch that's worth catching. There's governor limits that could be exceeded, which you can't catch, and the ...
sfdcfox's user avatar
  • 495k
3 votes

StandardSetController - how does it work?

StandardController From the docs : A Visualforce controller is a set of instructions that specify what happens when a user interacts with the components specified in associated Visualforce ...
Nihar's user avatar
  • 1,182
3 votes
Accepted

StandardSetController Test Class - 'Constructor not defined'

The StandardSetController class has two constructors, one accepts a list of sobjects and the other accepts a query locator. There is no constructor which accepts just a single record which is why you ...
Mark Pond's user avatar
  • 23k
3 votes

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

It is not possible for a single VF page to do this, but you can create 2 VF pages and have them use the same controller extension, using the same notation you used above. Single Record Handler <...
abd3721's user avatar
  • 2,162
3 votes

Error in Test class

The problem is this line here: MassEditOppController objC = new MassEditOppController(new ApexPages.StandardController()); There's two problems; first, your constructor uses an ApexPages....
sfdcfox's user avatar
  • 495k
3 votes
Accepted

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

They ask for one test method to cover the whole extension class and it's methods. When you're asked to do something specific, go ahead and do it, even if it's not your usual thing. As developers, we ...
sfdcfox's user avatar
  • 495k
3 votes
Accepted

Is a "Content Source" of "Visualforce Page" required for Ids for the checked list view items to be received by a StandardSetController?

Yes you are correct. Maybe you have to create multiple VF pages but you could create a VF component that does the bulk of the work. Create an attribute to that component that is set via the page and ...
gNerb's user avatar
  • 9,500
3 votes
Accepted

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

I did come across this known issue on the SFDC side; however, it didn't specify if it was classic only or not. I'm hypothesizing that this is largely due to the fact that Lightning appears to process ...
Jason Hardy's user avatar
2 votes
Accepted

StandardSetController.getRecords() is returning unrelated records

I can see why this functionality does not work in a related list. It's frustrating, but there is no list view to filter by, and that's really what the StandardSetController is using to figure out the ...
Adrian Larson's user avatar
  • 150k
2 votes

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

Weighing in with a not so nice but working workaround to use the standard set controller for the pagination yet have the ability to select records and pick these up within your controller without a ...
Art of Cloud's user avatar
2 votes
Accepted

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

If I take an org with over 50000 Account records and run this snippet, I don't get any errors and I do get the expected output: ApexPages.StandardSetController controller = new ApexPages....
Adrian Larson's user avatar
  • 150k
2 votes
Accepted

Attempt to de-reference a null object (at standardSetController)

It's because setCon is still null at the point where you're trying to access it. You can fix this by updating your constructor: public AccountTable(){ regionOptions = new List<SelectOption>...
sfdcfox's user avatar
  • 495k
2 votes
Accepted

How does the getCompleteResult method work for standard set controllers

The StandardSetController has a limit of 10,000 records. If your query returns more than that, the result will be incomplete. The documentation does exactly what it says: Indicates whether there ...
Adrian Larson's user avatar
  • 150k
2 votes
Accepted

StandardSetController with History records

After doing a bit of research, the best approach (and maybe the only one?) is what @sfdcfox suggested: create the pagination logic in the controller. The snippet he included was: public class ...
Javier García's user avatar
2 votes

StandardSetController Test coverage - records not selected

You need to use StandardSetcontoller object instance and use setSelected (contacts) method to assign selectedContact values Refer setSelected(selectedRecords)
Santanu Boral's user avatar
2 votes

StandardSetController Test coverage - records not selected

This pattern may help to get the coverage. there is no setter method for this public PageReference sendSurveys(){ List<Contact> selectedContacts = (List<Contact>) standardController....
Avijit Chakraborty's user avatar
2 votes

Query based on the Listview filter and the account id

Tricky. You could pull out all IDs from the listview (up to 10K) and then use them in your own query filtered by Account Id. Not sure if there's a better way, Listviews have IsSoqlCompatible field but ...
eyescream's user avatar
  • 24.1k
2 votes
Accepted

How to use this getLimitQueryLocatorRows() before actual query

It looks like there's a typo in the current documentation for getLimitQueryLocatorRows(). It should say this returns an integer with the number of records that can be returned by the Database....
crmprogdev's user avatar
2 votes

Is there a way to determine if an object supports list view?

I researched something similar recently and stumbled upon across this standard object ListView The ListView record tells you if the ListView is SOQL compatible,(which you are trying to do) So you go ...
Pranay Jaiswal's user avatar
2 votes

Maximum view state size limit (170KB) exceeded. Actual view state size for this page was 173,767KB

You're basically trying to store every record in the database in the view state. This is not going to work. Even if you didn't get a view state size error, you'd get errors for querying too many ...
sfdcfox's user avatar
  • 495k
2 votes

Apply pagination in Rest Resource

I would suggest you do the following: Add an autonumber field to Asset Adapt the queryMore pattern used in OOTB REST. Change your query to look something like this: ... WHERE MyAutoNumberField__c &...
cropredy's user avatar
  • 71.9k
1 vote

how to cover apex standard set controller variable in test class?

if you try to access the variable in your test method, the getter will be executed and you will be covering the variable. @istest public class testClass{ @istest static void test()...
erkan çipil's user avatar
1 vote
Accepted

Combine results from 2 standard set controllers or add to the read only results. Is there any way to do this?

Generally speaking, you'll have to use the alternative StandardSetController syntax, namely the one that accepts a list: // clone to clear the list read-only attribute SObject[] allRecords = [SELECT ...
sfdcfox's user avatar
  • 495k

Only top scored, non community-wiki answers of a minimum length are eligible