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
Surender reddy SalukutiSurender reddy Salukuti 

error using extenstion

Hi Every one,

I wrote program using Extension concpt

Apex program
public class Quick_quote {
    public Account acc      {set;get;}
    public contact con      {set;get;}
    public opportunity opt  {set;get;}
    public string quotename {set;get;}
    
    public Quick_quote(Apexpages.StandardController controller){
        List<string> fields = new List<string>{'name','phone','industry','rating'};
            controller.addfields(fields);
           con=new contact();
           opt= new opportunity();
        acc=(account)controller.getRecord();
    } 
    }
Visual force program

<apex:page standardController="Account" extensions="Quick_quote">
   <apex:sectionHeader title="Quick quote" subtitle="new quick quote"/> 
    <apex:form>
        <apex:pageblock>
    <apex:pageBlockSection title="Account" collapsible="false">
        <apex:inputField value="{!Account.name}"/>
        <apex:inputField value="{!account.phone}"/>
        <apex:inputField value="{!account.industry}"/>
        <apex:inputField value="{!account.rating}"/>
        </apex:pageBlockSection>
        <apex:pageBlockSection title="Contact" collapsible="false">
            <apex:inputText value="{!con.firstname}"/>
            <apex:inputText value="{!con.lastname}"/>
            <apex:inputText value="{!con.phone}"/>
            <apex:inputText value="{!con.Email}"/>
        </apex:pageBlockSection>
            <apex:pageBlockSection title="opportunty" collapsible="false">
                <apex:inputText value="{!quotename}"/>
                </apex:pageBlockSection>
            </apex:pageblock>
    </apex:form>
    </apex:page>

When i am executig this program i am getting error 
Error-
Maximum stack depth reached: 1001 

Thank you
surender reddy

 
DheerajKumar@SalesforceDheerajKumar@Salesforce
Hi Surender,

I have tried with your given program and I am not able to see Maximum stack depth reached: 1001. Visualforce page is loading successfully. Is there any extra code is there in Visaulforce page and class? So I can look into this.

User-added image

This Maximum stack depth reached: 1001. This would happen an infinitum, but the system has a safety in place that detects this type of infinite recursion. The error is caused by having a recursion problem (Salesforce has a limit of 1000 for the number of nested recursions you can perform to stop infinite looping).

If there is any recursion in program then this error will occur.

Thanks
Dheeraj Kumar