function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
I wanna create a form who allows the creation of multiple records in one time, for example 10 opportunities or 10 contacts.
Yes we can.
link
--lvivanin
<!-- visualforce page !-->
<apex:page controller="mypagecontroller"><apex:form ><apex:pageBlock >
<apex:pageblockbuttons ><apex:commandButton action="{!saving}" value="save" /></apex:pageblockbuttons>
<apex:repeat value="{!myrecords }" var="itr">Name : <apex:inputField value="{!itr.Name}"/>Select Age :<apex:inputField value="{!itr.Age__c}" /> <br/></apex:repeat>
</apex:pageBlock></apex:form></apex:page>
<!-- apex class !-->
public class mypagecontroller {//attributes|propertiespublic list <volunteer__c> myrecords {get;set;}
//constructorpublic mypagecontroller(){myrecords =new list <volunteer__c> ();myrecords.add(new volunteer__c());myrecords.add(new volunteer__c());myrecords.add(new volunteer__c());myrecords.add(new volunteer__c());myrecords.add(new volunteer__c());}
//methods|functions
public void saving (){ insert myrecords ; }
}
Yes we can.
link
--lvivanin
All Answers
Yes we can.
link
--lvivanin
<!-- visualforce page !-->
<apex:page controller="mypagecontroller">
<apex:form >
<apex:pageBlock >
<apex:pageblockbuttons >
<apex:commandButton action="{!saving}" value="save" />
</apex:pageblockbuttons>
<apex:repeat value="{!myrecords }" var="itr">
Name : <apex:inputField value="{!itr.Name}"/>
Select Age :<apex:inputField value="{!itr.Age__c}" /> <br/>
</apex:repeat>
</apex:pageBlock>
</apex:form>
</apex:page>
<!-- apex class !-->
public class mypagecontroller {
//attributes|properties
public list <volunteer__c> myrecords {get;set;}
//constructor
public mypagecontroller(){
myrecords =new list <volunteer__c> ();
myrecords.add(new volunteer__c());
myrecords.add(new volunteer__c());
myrecords.add(new volunteer__c());
myrecords.add(new volunteer__c());
myrecords.add(new volunteer__c());
}
//methods|functions
public void saving ()
{ insert myrecords ; }
}