You need to sign in to do that
Don't have an account?
ch ranjeeth
I want to insert records when the page is refreshed...i have written some code but its working with when i saving the page.Need help to wtire this code
<apex:page controller="Recordinsertion" action="{!method}">
</apex:page>
Controller:
public with sharing class Recordinsertion {
public PageReference method()
{
list<account> acclist=new list<account>();
for(integer i=50;i<51;i++)
{
account a=new account();
a.name='acc'+i;
acclist.add(a);
}
insert acclist;
return null;
}
}
</apex:page>
Controller:
public with sharing class Recordinsertion {
public PageReference method()
{
list<account> acclist=new list<account>();
for(integer i=50;i<51;i++)
{
account a=new account();
a.name='acc'+i;
acclist.add(a);
}
insert acclist;
return null;
}
}
Deepak Kumar Shyoran
This will insert Account records every time when you reload this page. Are you facing any problem in this ?