+ Start a Discussion
jls_74_txjls_74_tx 

1,000 Record Limit Error

I'm reading that the record limit was raised from 1,000 to 50,000 but I'm still getting an error that my results produce 3,411 records with the second select statement. What am I doing wrong?

 

public class referralExtension{

public Apartment__c Apt;
public ApexPages.StandardController controller {get; set;}
public List<Referral__c> referrals; public referralExtension (ApexPages.Standardcontroller c)
{


this.controller = c; Apt = (Apartment__c)Controller.getRecord();}
public Referral__c [ ] getReferralList()
{referrals = ([Select CreatedDate,Name,Actual_Move_Date__c,Apartment__c,Approximate_Move_Date__c,Client_Began_On__c,ClientDetails__c,Client_Name__c,Confirmed_By__c,Lease_Term__c,Locators_Email__c,Locators_Phone__c,NAAL_Member__c,Referring_Company__c,Referring_Locator__c,Rent__c,Reservation_Date__c,Reservation_Time__c,Unit__c,Unit_Description__c,Unit_Number__c from Referral__c Where Apartment__c = :Apt.id ORDER BY Approximate_Move_Date__c]);
return referrals;}

 

public Apartment__c [ ] getApartmentDirectory()
{return [Select ID,Complex_Name__c from Apartment__c Where Owner.Id = '005A0000000OJ3b'];
}
}

 

Thank You and Kuddos!

Best Answer chosen by Admin (Salesforce Developers) 
jls_74_txjls_74_tx

This is what worked

 

<apex:page sidebar="false" showHeader="false" cache="false" standardController="Apartment__c" extensions="referralExtension" readOnly="true" >
<apex:image url="http://www.locatormls.com/staticfiles/misc/banner8.png"/>
    <apex:repeat value="{!ApartmentDirectory}" var="ad" >
        <apex:panelGrid width="1200" columns="5">
            <apex:outputText style="color:#0071BC;font-weight:bold;font-size:12px;font-family:trebuchet ms" value="{!ad.Complex_Name__c}"></apex:outputText> 
        </apex:panelGrid>
    </apex:repeat>
</apex:page>

 

public class referralExtension{
 
public Apartment__c Apt;
public ApexPages.StandardController controller {get; set;}
public List<Referral__c> referrals; public referralExtension (ApexPages.Standardcontroller c)
{   
this.controller = c;    Apt = (Apartment__c)Controller.getRecord();}
        public Referral__c [ ] getReferralList()
        {referrals = ([Select CreatedDate,Name,Actual_Move_Date__c,Apartment_Name__c,Lease_Expiration__c,Apartment__c,Approximate_Move_Date__c,
        Client_Began_On__c,ClientDetails__c,Client_Name__c,Confirmed_By__c,Lease_Term__c,Locators_Email__c,Locators_Phone__c,NAAL_Member__c,
        Referring_Company__c,Referring_Locator__c,Rent__c,Reservation_Date__c,Reservation_Time__c,Unit__c,
        Unit_Description__c,Unit_Number__c from Referral__c Where Apartment__c = :Apt.id ORDER BY Approximate_Move_Date__c]); 
       return referrals;}

        public Apartment__c [ ] getApartmentDirectory()
        {return [Select ID,Complex_Name__c from Apartment__c ORDER BY Complex_Name__c];
        }
}

 

All Answers

Prafull G.Prafull G.
What API version you are using?
jls_74_txjls_74_tx
27.0
Naidu PothiniNaidu Pothini

If you are using this list on visualforce page, can you post the code here?

 

If know that if you are displaying the list on visualforce page througn an iteration component then it will throw you an error.

jls_74_txjls_74_tx

I am using a VF page with a repeat component.  I need a very basic list of every apartment in my database.  There isn't an object ahead of Apartment__c in my hierarchy so the only way I could think to display all records is with a custom controller by owner.  PageBlockTable won't work and for various reasons I can't use an enhancedList either.  Any other ideas?

 

<apex:page sidebar="false" showHeader="false" cache="false" standardController="Apartment__c" extensions="referralExtension" >
<apex:image url="http://www.locatormls.com/misc/banner8.png"/>
<apex:repeat value="{!ApartmentDirectory}" >
<apex:panelGrid width="1200" columns="5">
<apex:outputText value="{!Apartment__c.Complex_Name__c}"></apex:outputText>
</apex:panelGrid>
</apex:repeat>
</apex:page>

jungleeejungleee

Hi ,

 

Please check by setting the readOnly Attribute in the <apex:Page> to true. This allows page to display as many as 10000 records.

 

something like this : <apex:page readOnly = "true">

 

Regards

Sameer

Naidu PothiniNaidu Pothini
<apex:page sidebar="false" showHeader="false" cache="false" standardController="Apartment__c" extensions="referralExtension" >
        <apex:image url="http://www.locatormls.com/misc/banner8.png"/>
	<apex:repeat value="{!ApartmentDirectory}"  var="ad" >
		<apex:repeat value="{!ad}"  var="x">
			<apex:panelGrid width="1200" columns="5">
			<apex:outputText value="{!x.Complex_Name__c}"></apex:outputText>
			</apex:panelGrid>
		</apex:repeat>
	</apex:repeat>
</apex:page>

 

public class referralExtension
{
	public Apartment__c Apt;
	public ApexPages.StandardController controller {get; set;}
	public List<Referral__c> referrals;
	public List<List<Referral__c>> refList;

	public referralExtension (ApexPages.Standardcontroller c)
	{

	this.controller = c;
	Apt = (Apartment__c)Controller.getRecord();}
	public Referral__c [ ] getReferralList()
	{
referrals = new List<Referral__c>();
refList = new List<List<Referral__c>>();
for(Referral__c rf :[SELECT CreatedDate, Name, Actual_Move_Date__c, Apartment__c, Approximate_Move_Date__c, Client_Began_On__c, ClientDetails__c, Client_Name__c, Confirmed_By__c,Lease_Term__c, Locators_Email__c, Locators_Phone__c, NAAL_Member__c, Referring_Company__c, Referring_Locator__c, Rent__c, Reservation_Date__c, Reservation_Time__c,Unit__c, Unit_Description__c, Unit_Number__c FROM Referral__c WHERE Apartment__c = :Apt.id ORDER BY Approximate_Move_Date__c]) { referrals.add(rf); if(referrals.size() == 1000) { refList.add(referrals); referrals = new List<Referral__c>(); } } return referrals; } public Apartment__c [ ] getApartmentDirectory() { return [Select Id,Complex_Name__c from Apartment__c Where Owner.Id = '005A0000000OJ3b']; } }

Try this.  if you have any limitations to use the page in Read Only mode.

Gud luck.

jls_74_txjls_74_tx

This is what worked

 

<apex:page sidebar="false" showHeader="false" cache="false" standardController="Apartment__c" extensions="referralExtension" readOnly="true" >
<apex:image url="http://www.locatormls.com/staticfiles/misc/banner8.png"/>
    <apex:repeat value="{!ApartmentDirectory}" var="ad" >
        <apex:panelGrid width="1200" columns="5">
            <apex:outputText style="color:#0071BC;font-weight:bold;font-size:12px;font-family:trebuchet ms" value="{!ad.Complex_Name__c}"></apex:outputText> 
        </apex:panelGrid>
    </apex:repeat>
</apex:page>

 

public class referralExtension{
 
public Apartment__c Apt;
public ApexPages.StandardController controller {get; set;}
public List<Referral__c> referrals; public referralExtension (ApexPages.Standardcontroller c)
{   
this.controller = c;    Apt = (Apartment__c)Controller.getRecord();}
        public Referral__c [ ] getReferralList()
        {referrals = ([Select CreatedDate,Name,Actual_Move_Date__c,Apartment_Name__c,Lease_Expiration__c,Apartment__c,Approximate_Move_Date__c,
        Client_Began_On__c,ClientDetails__c,Client_Name__c,Confirmed_By__c,Lease_Term__c,Locators_Email__c,Locators_Phone__c,NAAL_Member__c,
        Referring_Company__c,Referring_Locator__c,Rent__c,Reservation_Date__c,Reservation_Time__c,Unit__c,
        Unit_Description__c,Unit_Number__c from Referral__c Where Apartment__c = :Apt.id ORDER BY Approximate_Move_Date__c]); 
       return referrals;}

        public Apartment__c [ ] getApartmentDirectory()
        {return [Select ID,Complex_Name__c from Apartment__c ORDER BY Complex_Name__c];
        }
}

 

This was selected as the best answer