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
Becky Miller 15Becky Miller 15 

New Coder Help - Adding Multiple Lines in Code

I am getting a couple of errors with the Controller which then gives me an error in Visualforce page.  

I am trying to let the user add multiple rows of information from one screen.  I am trying to allow the user to hit Add in the table so that we can get more information.   I will need another table with the same capability to be able to add another row.  Most of the time we won't need to add a row but I would rather do it right the first time.   I am just learning how to do this so any guidance would be great.



Apex Class
public class MultiAdd
{
    //will hold the Endora records to be saved
    public List<Endora_Information__c> lstEndora = new List<Endora_Information__c>();

    //list of the inner class

    public List<innerClass> lstInner

    {   get;set;    }

    //will indicate the row to be deleted

    public String selectedRowIndex
    {get;set;} 
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}

    ////save the records by adding the elements in the inner class list to lstinner,return to the same page

    public PageReference Save()

    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        for(Integer j = 0;j<lstEndoras.size();j++)
        {
            lstInner.add(lstEndora[j].endora__c);   (error)
        }
        insert lstInner;
        pr.setRedirect(True);
        return pr;

    }

    //add one more row

    public void Add()

    {  

        count = count+1;

        addMore();     

    }

    /*Begin addMore*/

    public void addMore()

    {

        //call to the iner class constructor

        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           

    }/* end addMore*/

    /* begin delete */

    public void Del()

    {

        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;

    }/*End del*/

    /*Constructor*/

    public MultiAdd(ApexPages.StandardController ctlr)

    {

        lstInner = new List<innerClass>();

        addMore();

        selectedRowIndex = '0';

    }/*End Constructor*/

    /*Endora Class*/

    public class innerClass

    {      

        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */

        public String recCount

        {get;set;}

        public Endora_Information__c endora

        {get;set;}

        /*Inner Class Constructor*/

        public innerClass(Integer intCount)

        {

            recCount = String.valueOf(intCount);       

            /*create a new endora record*/

            endora = new Endora_Information__c();

        }/*End Inner class Constructor*/   

    }
}
    /*End inner Class*/

Error:  Incompatible element type Decimal for collection of MultiAdd.innerClass

Visual Force page  (everything works that is bolded) 
Error: Line 1 Previous load of class failed: MultiAdd: line 28, column 13: Incompatible element type Decimal for collection of MultiAdd.innerClass


<apex:page standardController="Opportunity" extensions="MultiAdd" id="thePage">
    <apex:relatedList list="Endora_Information__c"/>
    <apex:form >
        <style type="text/css">
    .pbTitle {
        white-space: nowrap
             }
        </style>
        <apex:pageBlock title="Procedure Rooms: Quote 1 kiosk or 1 workflow software unit per procedure room.">
            How many total procedure rooms? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.Total_Procedure_Rooms__c}"/><p/>
            
            <b>PROCEDURE ROOM/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.PR_Qty_Kiosks__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.PR_Qty_WF_SF_Only__c}"/><p/>
         </apex:pageBlock>
        
         <apex:pageBlock title="Travel Carts">
            How many travel carts will track endoscopes? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_travel_carts__c}"/><p/>
            <b>TRAVEL CARTS/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.tc_qty_endora__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.tc_wf_sf_only__c}"/><p/>
         </apex:pageBlock>
        
        
        <apex:pageBlock title="Kiosk Mounts">
            Kiosk mount total by type for procedure rooms:? &nbsp;&nbsp; <p/>
            <b>KIOSK MOUNTS/QTY</b><p/>
            Flush Wall Mount #72233-847  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.Qty_flush_wall_mount__c}"/><p/>
            Flush Tilt Wall Mount #72233-849 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_tilt_wall_mount__c}"/><p/>
            Arm Wall Mount #72233-848  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.qty_arm_wall_mount__c}"/><p/>
            Floor Stand #72233-850 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_floor_stand__c}"/><p/>
         </apex:pageBlock>

        
        
        
        <apex:commandbutton value="Add" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save" action="{!Save}"/>
       

        
        apex:pageblock id="pb1">
        
     
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
                <apex:panelGrid headerClass="Endora">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>
                <apex:panelGrid title="Cleaning SINKS: Quote 1 kiosk and 1 kiosk mount per solution " >
                    <apex:facet name="header">Department</apex:facet>
                    <apex:inputfield value="{!e1.acct.ShippingCountry}"/>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                    <apex:facet name="header">Floor/Room#</apex:facet>
                    <apex:inputfield value="{!e1.acct.Active__c}"/>
                </apex:panelGrid>
                 
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
                    
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Type</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
                    
            </apex:panelgrid>
        </apex:repeat>
       
      </apex:form> 
</apex:page>
Best Answer chosen by Becky Miller 15
Becky Miller 15Becky Miller 15
Invalid field recCount for SObject Endora_Information__c


public class MultiAdd
{
    //will hold the account records to be saved
    public List<Endora_Information__c> lstAcct{
              get {
                   if(lstAcct == null)
                       return new List<Endora_Information__c>();
                   else
                       return lstAcct ;
                  }
                   set;
                  }

    //list of the inner class

    public List<innerClass> lstInner

    {get;set;}

    //will indicate the row to be deleted

    public String selectedRowIndex
    {get;set;} 
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}

    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page

    public PageReference Save()

    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].endora);
        }
        insert lstAcct;
        pr.setRedirect(True);
        return pr;

    }

    //add one more row

    public void Add()

    {  

        count = count+1;

        addMore();     

    }

    /*Begin addMore*/

    public void addMore()

    {

        //call to the iner class constructor

        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           

    }/* end addMore*/

    /* begin delete */

    public void Del()

    {

        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;

    }/*End del*/

    /*Constructor*/

    public MultiAdd(ApexPages.StandardController ctlr)

    {

        lstInner = new List<innerClass>();

        addMore();

        selectedRowIndex = '0';

    }/*End Constructor*/

    /*Inner Class*/

    public class innerClass

    {      

        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */

        public String recCount

        {get;set;}

        public Endora_Information__c endora

        {get;set;}

        /*Inner Class Constructor*/

        public innerClass(Integer intCount)

        {

            recCount = String.valueOf(intCount);       

            /*create a new account*/

            endora = new Endora_Information__c();

        }/*End Inner class Constructor*/   

    }
}
    /*End inner Class*/

All Answers

Vishwajeet kumarVishwajeet kumar
According to Error, it looks like Data is not getting assinged to correct data type.
Becky Miller 15Becky Miller 15
But the datatype is Number and I have to use the word Integer.  So, that is why I am confused.
Vishwajeet kumarVishwajeet kumar
For Number field type, you should use "Double" Data type.
Becky Miller 15Becky Miller 15
List index must be of type Integer: Double   Here is the new error when I changed the code from Integer to Double.
Vishwajeet kumarVishwajeet kumar
Can you make "selectedRowIndex" and " Rec Count", both variable as integer and see.
Becky Miller 15Becky Miller 15
Add Double for all Integers :  Still getting that error List index must be of type Integer: Double

public class MultiAdd
{
    //will hold the Endora records to be saved
    public List<Endora_Information__c> lstEndora = new List<Endora_Information__c>();

    //list of the inner class

    public List<innerClass> lstInner

    {   get;set;    }

    //will indicate the row to be deleted

    public Double selectedRowIndex
    {get;set;} 
    //no. of rows added/records in the inner class list
    public Double count = 1;
    //{get;set;}

    ////save the records by adding the elements in the inner class list to lstinner,return to the same page

    public PageReference Save()

    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        for(Double j = 0;j<lstEndoras.size();j++)
        {
            lstInner.add(lstEndora[j].endora__c);
        }
        insert lstInner;
        pr.setRedirect(True);
        return pr;

    }

    //add one more row

    public void Add()

    {  

        count = count+1;

        addMore();     

    }

    /*Begin addMore*/

    public void addMore()

    {

        //call to the iner class constructor

        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           

    }/* end addMore*/

    /* begin delete */

    public void Del()

    {

        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;

    }/*End del*/

    /*Constructor*/

    public MultiAdd(ApexPages.StandardController ctlr)

    {

        lstInner = new List<innerClass>();

        addMore();

        selectedRowIndex = '0';

    }/*End Constructor*/

    /*Endora Class*/

    public class innerClass

    {      

        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */

        public String recCount

        {get;set;}

        public Endora_Information__c endora

        {get;set;}

        /*Inner Class Constructor*/

        public innerClass(Double intCount)

        {

            recCount = Double.valueOf(intCount);       

            /*create a new endora record*/

            endora = new Endora_Information__c();

        }/*End Inner class Constructor*/   

    }
}
    /*End inner Class*/
Vishwajeet kumarVishwajeet kumar
well, no. i meant if there is a field in Page which is of type Number then you should use Double data type for storing it in custom variable.
and new error is because, we cannot use double for accessing the list index. Please change your data type to previous stage and check you page if you are assigning the value for field to variable or vice correctly.
Becky Miller 15Becky Miller 15
As I am learning: Not sure how to convert it “inner class”. Thank you for your patience. Becky Miller [Image result for salesforce certified developer icon] Advanced Salesforce.com Administrator [MEDIVATORS LOGO 285.jpg] 14605 28th Avenue N, Minneapolis, MN 55447 USA tel. 763.509.4792 | cell: 763.226.6651| fax 763.551.2688 bmiller@medivators.com | www.medivators.com The information contained in this e-mail is confidential and/or proprietary to Cantel Medical Corp. and/or its subsidiaries and affiliates, and is intended to be received by the individual or entity named above for limited use, without copying, forwarding, disclosing or otherwise transmitting this message to any other party. Please return this email if you received this message in error or are unable to acknowledge and protect the confidential/proprietary nature of its contents.
Vishwajeet kumarVishwajeet kumar
lstInner.add(lstEndora[j].endora__c);   (error)

Here "lstInner" list is of type "InnerClass" and we cannot add just a cutom object fields to it. you need to convert it "inner class" type and then add it to list. Field "endora__c" is from salesforce object, "Endora_Information__c". Type of both varibles are not matching.
Vishwajeet kumarVishwajeet kumar
Add below method in controller:
public static InnerClass createInnerClass (Endora_Information__c p_EI){
InnerClass v_inCls = new InnerClass();
v_inCls.Endora_Information__c  = p_EI;
return v_inCls ;
}

then update error line as :
lstInner.add(createInnerClass(lstEndora[j]));

it should work.
Becky Miller 15Becky Miller 15
I think I did something wrong.  (I really appreciate your help)

public class MultiAdd
{
    
    
       

    //will hold the Endora records to be saved
   public List<Endora_Information__c> lstEndora = new List<Endora_Information__c>();

    public static InnerClass createInnerClass (Endora_Information__c p_EI){
                  InnerClass v_inCls = new InnerClass();
                  v_inCls.Endora_Information__c  = p_EI;
                  return v_inCls ;
     }

    //list of the inner class

    public List<innerClass> lstEndoras

    {   get;set;    }

    //will indicate the row to be deleted

    public String selectedRowIndex
    {get;set;} 
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}

    ////save the records by adding the elements in the inner class list to lstEndora,return to the same page

    public PageReference Save()

    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        for(Double j = 0;j<lstEndoras.size();j++)
        {
            lstInner.add(createInnerClass(lstEndora[j]));
        }
        insert lstEndoras;
        pr.setRedirect(True);
        return pr;

    }

    //add one more row

    public void Add()

    {  

        count = count+1;

        addMore();     

    }

    /*Begin addMore*/

    public void addMore()

    {

        //call to the iner class constructor

        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
        lstEndoras.add(objInnerClass);   
        system.debug('lstEndoras---->'+lstEndoras);           

    }/* end addMore*/

    /* begin delete */

    public void Del()

    {

        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;

    }/*End del*/

    /*Constructor*/

    public MultiAdd(ApexPages.StandardController ctlr)

    {

        lstEndoras = new List<innerClass>();

        addMore();

        selectedRowIndex = '0';

    }/*End Constructor*/

    /*Endora Class*/

    public class innerClass

    {      

        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */

        public String recCount

        {get;set;}

        public Endora_Information__c endora

        {get;set;}

        /*Inner Class Constructor*/

        public innerClass(Integer intCount)

        {

            recCount = String.valueOf(intCount);       

            /*create a new endora record*/

            endora = new Endora_Information__c();

        }/*End Inner class Constructor*/   

    }
}
    /*End inner Class*/
Becky Miller 15Becky Miller 15
The only error I have is List index must be of type Integer: Double

      PageReference pr = new PageReference('/apex/MultiAdd');
        for(Double j = 0;j<lstEndoras.size();j++)
        {
            lstInner.add(createInnerClass(lstEndora[j]));
        }
        insert lstEndoras;
        pr.setRedirect(True);
        return pr;
Vishwajeet kumarVishwajeet kumar
change for(Double j = 0;j<lstEndoras.size();j++)
as for(integer j = 0;j<lstEndoras.size();j++)

it should fix it.
Becky Miller 15Becky Miller 15
Now the Visualforce Page Error:  Unknown property 'MultiAdd.innerClass.acct' = Line 1

<apex:page standardController="Opportunity" extensions="MultiAdd" id="thePage">
    <apex:relatedList list="Endora_Information__c"/>
    
    
    <apex:form >
        <style type="text/css">
    .pbTitle {
        white-space: nowrap
             }
        </style>
        <apex:pageBlock title="Procedure Rooms: Quote 1 kiosk or 1 workflow software unit per procedure room.">
            How many total procedure rooms? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.Total_Procedure_Rooms__c}"/><p/>
            
            <b>PROCEDURE ROOM/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.PR_Qty_Kiosks__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.PR_Qty_WF_SF_Only__c}"/><p/>
         </apex:pageBlock>
        
Vishwajeet kumarVishwajeet kumar
In Below Code, replace e1.acc by e1.endora.
This is no attribute called "acc" on class "innerClass", that's why this error is coming.

<apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
                <apex:panelGrid headerClass="Endora">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>
                <apex:panelGrid title="Cleaning SINKS: Quote 1 kiosk and 1 kiosk mount per solution " >
                    <apex:facet name="header">Department</apex:facet>
                    <apex:inputfield value="{!e1.acct.ShippingCountry}"/>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                    <apex:facet name="header">Floor/Room#</apex:facet>
                    <apex:inputfield value="{!e1.acct.Active__c}"/>
                </apex:panelGrid>
                 
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
                    
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Type</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Name}"/>
                </apex:panelGrid>
                    
            </apex:panelgrid>
        </apex:repeat>
Becky Miller 15Becky Miller 15
Thank you so much.  I will get that fixed up.  You are were amazing help.  Much apprecaited.
Becky Miller 15Becky Miller 15
New Error now on the Visual Force Page: Unknown property 'OpportunityStandardController.Endora_Information__r'


<apex:page standardController="Opportunity" extensions="MultiAdd" id="thePage">
    <apex:relatedList list="Endora_Information__r"/>
    <apex:form >
        <style type="text/css">
    .pbTitle {
        white-space: nowrap
             }
        </style>
        <apex:pageBlock title="Procedure Rooms: Quote 1 kiosk or 1 workflow software unit per procedure room.">
            How many total procedure rooms? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.Total_Procedure_Rooms__c}"/><p/>
            
            <b>PROCEDURE ROOM/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.PR_Qty_Kiosks__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.PR_Qty_WF_SF_Only__c}"/><p/>
         </apex:pageBlock>
        
         <apex:pageBlock title="Travel Carts">
            How many travel carts will track endoscopes? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_travel_carts__c}"/><p/>
            <b>TRAVEL CARTS/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.tc_qty_endora__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.tc_wf_sf_only__c}"/><p/>
         </apex:pageBlock>
        
        
        <apex:pageBlock title="Kiosk Mounts">
            Kiosk mount total by type for procedure rooms:? &nbsp;&nbsp; <p/>
            <b>KIOSK MOUNTS/QTY</b><p/>
            Flush Wall Mount #72233-847  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.Qty_flush_wall_mount__c}"/><p/>
            Flush Tilt Wall Mount #72233-849 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_tilt_wall_mount__c}"/><p/>
            Arm Wall Mount #72233-848  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.qty_arm_wall_mount__c}"/><p/>
            Floor Stand #72233-850 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_floor_stand__c}"/><p/>
         </apex:pageBlock>
        
        
        
        <apex:commandbutton value="Add" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save" action="{!Save}"/>
       

        
        apex:pageblock id="pb1">
        
     
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
                <apex:panelGrid headerClass="Endora">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                    
                </apex:panelGrid>
                <apex:panelGrid title="Cleaning SINKS: Quote 1 kiosk and 1 kiosk mount per solution " >
                    <apex:facet name="header">Department</apex:facet>
                    <apex:selectList value="{!Endora_Information__r.Account_Dept__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!Endora_Information__r.Account_Dept__c}"/>
                </apex:selectList>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                    <apex:facet name="header">Floor/Room#</apex:facet>
                    <apex:inputfield value="{!Endora_Information__r.Floor_Room__c}"/>
                </apex:panelGrid>
                 
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!Endora_Information__r.Kiosk_Qty__c}"/>
                </apex:panelGrid>
                    
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Type</apex:facet>
                    <apex:selectList value="{!Endora_Information__r.Mount_Type__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!Endora_Information__r.Mount_Type__c}"/>
                </apex:selectList>
                </apex:panelGrid>
              
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Quantity</apex:facet>
                    <apex:inputfield value="{!Endora_Information__r.Mount_Qty__c}"/>
                </apex:panelGrid>
                    
            </apex:panelgrid>
        </apex:repeat>
       
      </apex:form> 
</apex:page>
Vishwajeet kumarVishwajeet kumar
Error is due to line : <apex:relatedList list="Endora_Information__r"/>

Check if opportunity has child relationship with Object "Endora_Information__C"? if yes what is correct child relationship name.
Child relationship name exists on lookup field.Use the correct name in above error line list variable.
Becky Miller 15Becky Miller 15
Error = Unknown property 'OpportunityStandardController.Endora_Information__c'  (I am feeling determine and i really appreciate you patiences)

<apex:page standardController="Opportunity" extensions="MultiAdd" id="thePage">
    <apex:relatedList list="!Opportunity.Opportunity_Endora_Information__c"/>
    <apex:form >
        <style type="text/css">
    .pbTitle {
        white-space: nowrap
             }
        </style>
        <apex:pageBlock title="Procedure Rooms: Quote 1 kiosk or 1 workflow software unit per procedure room.">
            How many total procedure rooms? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.Total_Procedure_Rooms__c}"/><p/>
            
            <b>PROCEDURE ROOM/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.PR_Qty_Kiosks__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.PR_Qty_WF_SF_Only__c}"/><p/>
         </apex:pageBlock>
        
         <apex:pageBlock title="Travel Carts">
            How many travel carts will track endoscopes? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_travel_carts__c}"/><p/>
            <b>TRAVEL CARTS/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.tc_qty_endora__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.tc_wf_sf_only__c}"/><p/>
         </apex:pageBlock>
        
        
        <apex:pageBlock title="Kiosk Mounts">
            Kiosk mount total by type for procedure rooms:? &nbsp;&nbsp; <p/>
            <b>KIOSK MOUNTS/QTY</b><p/>
            Flush Wall Mount #72233-847  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.Qty_flush_wall_mount__c}"/><p/>
            Flush Tilt Wall Mount #72233-849 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_tilt_wall_mount__c}"/><p/>
            Arm Wall Mount #72233-848  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.qty_arm_wall_mount__c}"/><p/>
            Floor Stand #72233-850 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_floor_stand__c}"/><p/>
         </apex:pageBlock>
        
        
        
        <apex:commandbutton value="Add" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save" action="{!Save}"/>
       

        
      
       
     
        <apex:repeat value="{!Endora_Information__c}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
                <apex:panelGrid headerClass="Endora">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                    
                </apex:panelGrid>
                <apex:panelGrid title="Cleaning SINKS: Quote 1 kiosk and 1 kiosk mount per solution " >
                    <apex:facet name="header">Department</apex:facet>
                    <apex:selectList value="{!e1.Opportunity_Name__c.Account_Dept__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!e1.Account_Dept__c}"/>
                </apex:selectList>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                    <apex:facet name="header">Floor/Room#</apex:facet>
                    <apex:inputfield value="{!e1.Floor_Room__c}"/>
                </apex:panelGrid>
                 
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!e1.Kiosk_Qty__c}"/>
                </apex:panelGrid>
                    
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Type</apex:facet>
                    <apex:selectList value="{!e1.Mount_Type__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!e1.Mount_Type__c}"/>
                </apex:selectList>
                </apex:panelGrid>
              
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Quantity</apex:facet>
                    <apex:inputfield value="{!e1.Mount_Qty__c}"/>
                </apex:panelGrid>
                
           
            </apex:panelgrid>
        </apex:repeat>
       
      </apex:form> 
</apex:page>
 
Vishwajeet kumarVishwajeet kumar
Child Relationship name doesn't sounds correct.
Check below example, it has child relationship name for Contacts , on Account object. field is on Contact.
User-added image
Vishwajeet kumarVishwajeet kumar
on Account related Visualforce page it will like :
<apex:page standardController="Account" extensions="SomeExtensionController">
<apex:relatedlist list="Contacts"/>
</apex:page>

Simlar, way you need to find child relationship name from "Endora information" object, lookup field to Opportunity and use its name in page.
Becky Miller 15Becky Miller 15
<apex:page standardController="Opportunity" extensions="MultiAdd" id="thePage">
    <apex:relatedList list="Opportunities"/>
    <apex:form >
        <style type="text/css">
    .pbTitle {
        white-space: nowrap
             }
        </style>


I think the issue is here now;
        <apex:repeat value="{!Endora_Information__c}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
                <apex:panelGrid headerClass="Endora">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                    
                </apex:panelGrid>
                <apex:panelGrid title="Cleaning SINKS: Quote 1 kiosk and 1 kiosk mount per solution " >
                    <apex:facet name="header">Department</apex:facet>
                    <apex:selectList value="{!e1.Opportunity_Name__c.Account_Dept__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!e1.Account_Dept__c}"/>
                </apex:selectList>
                </apex:panelGrid>

 
Vishwajeet kumarVishwajeet kumar
Line: <apex:repeat value="{!Endora_Information__c}" var="e1" id="therepeat">.
Modify line as :
<apex:repeat value="{!lstEndora }" var="e1" id="therepeat">

apex:repeat uses list/Map type variable. 
Becky Miller 15Becky Miller 15
starting to feel like a real idiot.  :(   Going to owe you something .  thank you so much.

Error:Unknown property 'OpportunityStandardController.lstEndora' 

<apex:page standardController="Opportunity" extensions="MultiAdd" id="thePage">
    <apex:relatedList list="Opportunities"/>
    <apex:form >
        <style type="text/css">
    .pbTitle {
        white-space: nowrap
             }
        </style>
        <apex:pageBlock title="Procedure Rooms: Quote 1 kiosk or 1 workflow software unit per procedure room.">
            How many total procedure rooms? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.Total_Procedure_Rooms__c}"/><p/>
            
            <b>PROCEDURE ROOM/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.PR_Qty_Kiosks__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.PR_Qty_WF_SF_Only__c}"/><p/>
         </apex:pageBlock>
        
         <apex:pageBlock title="Travel Carts">
            How many travel carts will track endoscopes? &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_travel_carts__c}"/><p/>
            <b>TRAVEL CARTS/QTY</b><p/>
            ENDORA kiosks #45040-73  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.tc_qty_endora__c}"/><p/>
            Workflow Software only (customer provides hardware) #ENDO-777 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.tc_wf_sf_only__c}"/><p/>
         </apex:pageBlock>
        
        
        <apex:pageBlock title="Kiosk Mounts">
            Kiosk mount total by type for procedure rooms:? &nbsp;&nbsp; <p/>
            <b>KIOSK MOUNTS/QTY</b><p/>
            Flush Wall Mount #72233-847  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.Qty_flush_wall_mount__c}"/><p/>
            Flush Tilt Wall Mount #72233-849 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_tilt_wall_mount__c}"/><p/>
            Arm Wall Mount #72233-848  &nbsp;&nbsp; 
            <apex:inputText value="{!Opportunity.qty_arm_wall_mount__c}"/><p/>
            Floor Stand #72233-850 &nbsp;&nbsp;
            <apex:inputText value="{!Opportunity.qty_floor_stand__c}"/><p/>
         </apex:pageBlock>
        
        
        
        <apex:commandbutton value="Add" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save" action="{!Save}"/>
       

        
      
       
     
        <apex:repeat value="{!lstEndora}" var="e1" id="therepeat">
                <apex:panelGrid columns="5">
                <apex:panelGrid headerClass="Endora">
                    <apex:facet name="header">Del</apex:facet>
                    <apex:commandButton value="X" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                    
                </apex:panelGrid>
                <apex:panelGrid title="Cleaning SINKS: Quote 1 kiosk and 1 kiosk mount per solution " >
                    <apex:facet name="header">Department</apex:facet>
                    <apex:selectList value="{!e1.Opportunity_Name__c.Account_Dept__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!e1.Account_Dept__c}"/>
                </apex:selectList>
                </apex:panelGrid>
                    
                <apex:panelGrid >
                    <apex:facet name="header">Floor/Room#</apex:facet>
                    <apex:inputfield value="{!e1.Floor_Room__c}"/>
                </apex:panelGrid>
                 
                <apex:panelGrid >
                 <apex:facet name="header">Kiosk Quantity</apex:facet>
                    <apex:inputfield value="{!e1.Kiosk_Qty__c}"/>
                </apex:panelGrid>
                    
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Type</apex:facet>
                    <apex:selectList value="{!e1.Mount_Type__c}" multiselect="false" size="1" required="true">
                    <apex:inputfield value="{!e1.Mount_Type__c}"/>
                </apex:selectList>
                </apex:panelGrid>
              
                    
                <apex:panelGrid >
                 <apex:facet name="header">Mount Quantity</apex:facet>
                    <apex:inputfield value="{!e1.Mount_Qty__c}"/>
                </apex:panelGrid>
                
           
            </apex:panelgrid>
        </apex:repeat>
       
      </apex:form> 
</apex:page>

Class:
public class MultiAdd
{
    //will hold the account records to be saved
    public List<Endora_Information__c> lstAcct = new List<Endora_Information__c>();

    //list of the inner class

    public List<innerClass> lstInner

    {get;set;}

    //will indicate the row to be deleted

    public String selectedRowIndex
    {get;set;} 
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}

    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page

    public PageReference Save()

    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].endora);
        }
        insert lstAcct;
        pr.setRedirect(True);
        return pr;

    }

    //add one more row

    public void Add()

    {  

        count = count+1;

        addMore();     

    }

    /*Begin addMore*/

    public void addMore()

    {

        //call to the iner class constructor

        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           

    }/* end addMore*/

    /* begin delete */

    public void Del()

    {

        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;

    }/*End del*/

    /*Constructor*/

    public MultiAdd(ApexPages.StandardController ctlr)

    {

        lstInner = new List<innerClass>();

        addMore();

        selectedRowIndex = '0';

    }/*End Constructor*/

    /*Inner Class*/

    public class innerClass

    {      

        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */

        public String recCount

        {get;set;}

        public Endora_Information__c endora

        {get;set;}

        /*Inner Class Constructor*/

        public innerClass(Integer intCount)

        {

            recCount = String.valueOf(intCount);       

            /*create a new account*/

            endora = new Endora_Information__c();

        }/*End Inner class Constructor*/   

    }
}
    /*End inner Class*/
Vishwajeet kumarVishwajeet kumar
Line : <apex:repeat value="{!lstEndora}" var="e1" id="therepeat">

 needs to be changed as :
<apex:repeat value="{!lstAcct }" var="e1" id="therepeat">

Variable Name for "Endora Information" object list is "lstAcct" in controller.

This should fix it.
 
Becky Miller 15Becky Miller 15
Now this error.  :( 

Unknown property 'OpportunityStandardController.lstAcct' 

I did change it prior to asking you.  I see why it would be that because in the Controller I have documented the new Custom Object.
Vishwajeet kumarVishwajeet kumar
You should change Contoller line :
 public List<Endora_Information__c> lstAcct = new List<Endora_Information__c>();

as 
public List<Endora_Information__c> lstAcct{
get {
if(lstAcct == null)
return new List<Endora_Information__c>();
else
return lstAcct ;
}
set;
}

Page Dosen't have access to List Variable.
 
Becky Miller 15Becky Miller 15
Invalid field recCount for SObject Endora_Information__c


public class MultiAdd
{
    //will hold the account records to be saved
    public List<Endora_Information__c> lstAcct{
              get {
                   if(lstAcct == null)
                       return new List<Endora_Information__c>();
                   else
                       return lstAcct ;
                  }
                   set;
                  }

    //list of the inner class

    public List<innerClass> lstInner

    {get;set;}

    //will indicate the row to be deleted

    public String selectedRowIndex
    {get;set;} 
    //no. of rows added/records in the inner class list
    public Integer count = 1;
    //{get;set;}

    ////save the records by adding the elements in the inner class list to lstAcct,return to the same page

    public PageReference Save()

    {
        PageReference pr = new PageReference('/apex/MultiAdd');
        for(Integer j = 0;j<lstInner.size();j++)
        {
            lstAcct.add(lstInner[j].endora);
        }
        insert lstAcct;
        pr.setRedirect(True);
        return pr;

    }

    //add one more row

    public void Add()

    {  

        count = count+1;

        addMore();     

    }

    /*Begin addMore*/

    public void addMore()

    {

        //call to the iner class constructor

        innerClass objInnerClass = new innerClass(count);

        //add the record to the inner class list
        lstInner.add(objInnerClass);   
        system.debug('lstInner---->'+lstInner);           

    }/* end addMore*/

    /* begin delete */

    public void Del()

    {

        system.debug('selected row index---->'+selectedRowIndex);
        lstInner.remove(Integer.valueOf(selectedRowIndex)-1);
        count = count - 1;

    }/*End del*/

    /*Constructor*/

    public MultiAdd(ApexPages.StandardController ctlr)

    {

        lstInner = new List<innerClass>();

        addMore();

        selectedRowIndex = '0';

    }/*End Constructor*/

    /*Inner Class*/

    public class innerClass

    {      

        /*recCount acts as a index for a row. This will be helpful to identify the row to be deleted */

        public String recCount

        {get;set;}

        public Endora_Information__c endora

        {get;set;}

        /*Inner Class Constructor*/

        public innerClass(Integer intCount)

        {

            recCount = String.valueOf(intCount);       

            /*create a new account*/

            endora = new Endora_Information__c();

        }/*End Inner class Constructor*/   

    }
}
    /*End inner Class*/
This was selected as the best answer
Becky Miller 15Becky Miller 15
Still having issues can anyone help me out?