You need to sign in to do that
Don't have an account?
srinivas pulipati
Hi, i am writing this code in apex,Vf page but code is not execute error came please solve this error?
Apex code:
public class acclist {
List<account> acc=new List<Account>();
public void show(){
for(integer i=1;i<=4000;i++){
Account a=new Account(name='UserToday',industry='Banking');
acc.add(a);
}
insert acc;
}
}
Vf Code :
<apex:page controller="acclist" tabStyle="Account">
<apex:form>
<apex:pageBlock title="Create acccount">
<apex:commandButton value="show" action="{!show}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Error:
System.LimitException: Too many SOQL queries: 101
Error is in expression '{!show}' in component <apex:commandButton> in page acclist: Trigger.AccountInsert: line 3, column 1
Trigger.AccountInsert: line 3, column 1
public class acclist {
List<account> acc=new List<Account>();
public void show(){
for(integer i=1;i<=4000;i++){
Account a=new Account(name='UserToday',industry='Banking');
acc.add(a);
}
insert acc;
}
}
Vf Code :
<apex:page controller="acclist" tabStyle="Account">
<apex:form>
<apex:pageBlock title="Create acccount">
<apex:commandButton value="show" action="{!show}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Error:
System.LimitException: Too many SOQL queries: 101
Error is in expression '{!show}' in component <apex:commandButton> in page acclist: Trigger.AccountInsert: line 3, column 1
Trigger.AccountInsert: line 3, column 1
It look like some issue in your trigger. Please post your account trigger code
Hi Srinivas,
It seems like you have a SOQL inside loop so please post your trigger code.
Thanks,
Himanshu