You need to sign in to do that
Don't have an account?
Surender 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
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
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.
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