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 

Need help on developing custom visual force page and dynamic input table form for user input.


Hi, I am very new to salesforce and donot have much idea on apex coding/vf, I am looking for sample code & Suggestions to develop the below problem description as i need to develop and deliver this at the earliest.
Please help, Thank you!

Problem Description:
I need to develop custom visual force page where in the user can enter values in a form like page for various fields
and can also enter values in the dynamic table ie. the user can add any number of rows the the table and then the
user can save the form.

Fields: Accnt field -> is a field value from account object through master details relation ship b/w account and this object (say X).
Object X: for which the vf page is to be developed contains fields (fields2, fields 3, fields 4 and fields 5)

Table Name: is a separate object which is related to Object X.

I need to create a form which looks like the attach screen print so that the user can enter values
save/update etc. The user should be able to add/delete update multiple records in the table and the
records should related to the object X for each acc and related records should be displayed on view and can also be edited.

Also, i have just provided first section detail of the form to be developed, the remaining pages of the form is exactly replication of this page with differnt fields of
object X and then related tables of different object.

The table needs to be developed so that the user can add dynamically any number of rows or date or delete etc with buttons or any suggestions.

Any suggestions on data definition is also welcomed. thank you so much for the help.


Hi R Tandon, 


You have to create a Visualforce page that displays the form and also a controller with apex code in it which has the logic to add the records, i am pasting a sample below also go the links for additional information. 


 VF Code:

                                                 <apex:page controller="cls_dynamicrow">


                                                  <apex:outputPanel id = "refreshdata">

                                                   <apex:repeat value="{!propLstQuesAns}" var="varLQA" id="textquesrp">


                                                                <apex:inputtext value="{!varLQA.propAns}" id="textques"/></p>



                                                   <apex:commandButton action="{!DynamicRow}" reRender="refreshdata" value="ADD ROW"/>




Controller code:

                                                public class cls_dynamicrow


                                                  public List<WrapperQueAns> lstQueAns = new List<WrapperQueAns>{};

                                                  public List<WrapperQueAns> propLstQuesAns { get { return lstQueAns; } set { lstQueAns = value; } }

                                                  Public cls_dynamicrow(){

                                                                WrapperQueAns wqa = new WrapperQueAns();

                                                                wqa.propAns = '';



                                                  public void DynamicRow(){

                                                                for(Integer i=0;i<5;i++){

                                                                  WrapperQueAns wqa = new WrapperQueAns();

                                                                  wqa.propAns    = '';




                                                  public class WrapperQueAns{public String propAns   { get; set; } }//End Class WrapperQueAns