• haripopuri1
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies

Hi, 

 

i am getting the error as ' Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 135.344KB'. I am having morethan 5000 records but i am displaying 1000 records in my select option list. In view state 5000 records are loaded. I am getting this error. How can i solve this error. Please any one help me out.

 

Thanks,

Lakshmi.

Hey All,

I am having trouble with the below class and am hoping to get some help.  I have a Junction Object that is connecting two custom Objects, Order__c and Product_Bundle__c and I am creating a Visualforce Page that will allow the User to create the Junction Objects by adding Quantity to the records and saving the page.  The class is designed to:

1.  Query the Product_Bundle__c Custom Object for available Product Bundles and assocate them behind the scenes with the current Order__c

2.  Display them on a VF page with the inputField Quantity__c exposed

3.  If the User enters a quantity and clicks "Save", the system will create those Junction  Objects associating the Product Bundles to the Order

 

I cannot seem to get my PageBlockTable to use the list in my Controller:

ErrorError: Unknown property 'Order_Item_Junction__cStandardController.lstoitem'

 

Any help on the below code would be great!

 

Class

public class oitemController
{
    public List<Product_Bundle__c> lstbundle = new List<Product_Bundle__c>();
    public List<Order_Item_Junction__c> lstoitem = new List<Order_Item_Junction__c>();
    public string orderid;
    public boolean proceed {get;set;}
    
    public boolean setproceed()
    {
        return true;
    }
    
    public oitemController(ApexPages.StandardController controller)
    {
        string flag = '';
        //Order ID
        orderid = ApexPages.currentPage().getparameters().get('oid');
        //Record Type
        string orecordtype = ApexPages.currentPage().getparameters().get('rectype');
        //Use this variable to test the code coverage of try-catch block within constructor and set to 'true'
        String calledFromTestClass = ApexPages.currentPage().getparameters().get('calledFromTestClass');
        
            if(orecordtype == 'New Order')
            {            
                flag = 'new';
                //Fetch all Product Bundles where Order_Availability__c = New Order
                lstbundle = [Select Order_Availability__c, Name, Id From Product_Bundle__c where Order_Availability__c =:'New Order' and Completed__c =: TRUE order by Name];
            }
            else if(orecordtype == 'Return Order')
            {
                flag = 'return';
                //Fetch all Product Bundles where Order_Availability__c = Return Oder
                lstbundle = [Select Order_Availability__c, Name, Id From Product_Bundle__c where Order_Availability__c =:'Return Order' and Completed__c =: TRUE order by Name];
            }
        
        List<Order_Item_Junction__c> lstoitem = new List<Order_Item_Junction__c>();
        
        if(calledFromTestClass == 'true') {
            lstoitem = null;
        }
        
        try{
        for(integer i=0;i<lstbundle.size();i++)
        {
            Order_Item_Junction__c oitem = new Order_Item_Junction__c();
            oitem.Product_Bundle__c = lstbundle[i].Id;
            oitem.Order__c = orderid;
            lstoitem.add(oitem);
            
        }
        }catch(Exception ex){
            // Adding exeption message onto the page
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Error:'+ ex.getMessage()));
            System.debug(ex.getMessage());
        }
    }   
}

 Page

<apex:page id="orderpage1" standardController="Order_Item_Junction__c" extensions="oitemController" sidebar="false" showheader="false" >
<script type="text/javascript">
function refreshparent()
{
    window.opener.location.reload();
    window.close();
}
</script>
    <apex:form id="form1">
        <apex:pageBlock title="Add Order Items" id="order">
            <apex:pageBlockButtons location="top">
                <apex:commandButton status="processingimg" value="Save" action="{!save}" rerender="order" oncomplete="refreshparent()" />
                <apex:commandButton onclick="javascript&colon;window.close();" value="Cancel" />
                <apex:actionstatus id="processingimg" >
                    <apex:facet name="start">
                        <apex:image id="theImage" value="{!$Resource.ProcessingImage}" />
                    </apex:facet>
                </apex:actionstatus>
            </apex:pageBlockButtons>
                <apex:pageBlockSection id="pbsbundle" title="Available Product Bundles" rendered="true" columns="1">
                    <apex:pageBlockTable id="pbtbundles" value="{!lstoitem}" var="l" width="100%">
                        <apex:column headervalue="Product Bundle Name" value="{!l.Product_Bundle__c}" width="80%"/>
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton status="processingimg" value="Save" action="{!save}" rerender="order" oncomplete="refreshparent()"/>
                <apex:commandButton onclick="javascript&colon;window.close();" value="Cancel" />
                <apex:actionstatus id="processingimg1" >
                    <apex:facet name="start">
                        <apex:image id="theImage1" value="{!$Resource.ProcessingImage}" />
                    </apex:facet>
                </apex:actionstatus>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

  • January 10, 2012
  • Like
  • 0

I'm trying to make a VF page listing records using the StandardSetController.The problem I have is when dealing with more than 10 thousand records (I get an exception from the SetController). Is there a way to paginate records when the total amount of records is more than 10000? When using standard salesforce views for the object I see there are no problems with it so there has to be a way.

Thanks;

 

Farid

Hello Friends,

 

I know that there is a limit of 10000 rows for SOQL query.

But I have more than 10000 rows to process, how can I do that in pure VF/Apex approach.

 

Thanks,

Sunil

Hi all,

 

What's the best way to generate search engine friendly urls for dynamic content with sites? 

 

Scott

  • March 26, 2009
  • Like
  • 0