• Manish Jodhani
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hello everyone,
I'm new in saleforce and Here i got a problem regarding "Variable does not exist: Name"
I just want to create a visual page and here code and controller class.
Please take a look 

Visualpage code:
<apex:page standardController="Registration__c" extensions="Controller">
     <apex:form > 
         <apex:pageBlock ><center><h1>Registration Form</h1></center></apex:pageBlock>
         <apex:pageBlock title="Student Details" id="1">
                <apex:pageBlockSection title="Jadu">
                        <apex:inputField value="{! Registration__c.Name }"/>
                        <apex:inputField value="{! Registration__c.Father_s_Name__c }"/>        
                        <apex:inputField value="{! Registration__c.Mother_s_Name__c }"/>
                        <apex:inputField value="{! Registration__c.Phone__c }"/>   
                        <apex:inputField value="{! Registration__c.Birth_Date__c}"/>
                        <apex:inputField value="{! Registration__c.Gender__c}"/> 
                        <apex:inputField value="{! Registration__c.Email__c}"/>    
                        <apex:inputField Value="{! Registration__c.Address__c}"/>
                        <apex:inputField value="{! Registration__c.Pincode__c}"/>
                        <apex:inputField value="{! Registration__c.City__c}"/>
                        <apex:inputField value="{! Registration__c.Country__c}"/>
                        <apex:inputField Value="{! Registration__c.State__c}"/> 
                    </apex:pageBlockSection> 
                    <apex:pageBlockButtons location="bottom" >
                         <apex:commandButton action="{!save}" value="Save" />
                         <apex:commandButton action="{!show}" value="Show Registered Student " reRender="a" />
                    </apex:pageBlockButtons> 
            </apex:pageBlock>
            <apex:pageBlock title="Registrated Student" id="a">    
                {! Name} {! FatherName}         
             </apex:pageBlock>
        </apex:form>  
</apex:page>
Class code: 
public with sharing class Controller {
    public String Name;
    public String FatherName;
    public void show(){
       List<Registration__c> Reg = new List<Registration__c>();
        for(Registration__c obj :[select id, Father_s_Name__c,Name from Registration__c])
        {
          Reg.add(obj); 
        }
        Name = Reg.Name;
        FatherName = Reg.Father_s_Name__c;
    }
}
Problem:
Variable does not exist: Name.
Variable does not exist: Father_s_Name__c.
1 in line 0 of Registration page

Hello everyone,
I'm new in saleforce and Here i got a problem regarding "Variable does not exist: Name"
I just want to create a visual page and here code and controller class.
Please take a look 

Visualpage code:
<apex:page standardController="Registration__c" extensions="Controller">
     <apex:form > 
         <apex:pageBlock ><center><h1>Registration Form</h1></center></apex:pageBlock>
         <apex:pageBlock title="Student Details" id="1">
                <apex:pageBlockSection title="Jadu">
                        <apex:inputField value="{! Registration__c.Name }"/>
                        <apex:inputField value="{! Registration__c.Father_s_Name__c }"/>        
                        <apex:inputField value="{! Registration__c.Mother_s_Name__c }"/>
                        <apex:inputField value="{! Registration__c.Phone__c }"/>   
                        <apex:inputField value="{! Registration__c.Birth_Date__c}"/>
                        <apex:inputField value="{! Registration__c.Gender__c}"/> 
                        <apex:inputField value="{! Registration__c.Email__c}"/>    
                        <apex:inputField Value="{! Registration__c.Address__c}"/>
                        <apex:inputField value="{! Registration__c.Pincode__c}"/>
                        <apex:inputField value="{! Registration__c.City__c}"/>
                        <apex:inputField value="{! Registration__c.Country__c}"/>
                        <apex:inputField Value="{! Registration__c.State__c}"/> 
                    </apex:pageBlockSection> 
                    <apex:pageBlockButtons location="bottom" >
                         <apex:commandButton action="{!save}" value="Save" />
                         <apex:commandButton action="{!show}" value="Show Registered Student " reRender="a" />
                    </apex:pageBlockButtons> 
            </apex:pageBlock>
            <apex:pageBlock title="Registrated Student" id="a">    
                {! Name} {! FatherName}         
             </apex:pageBlock>
        </apex:form>  
</apex:page>
Class code: 
public with sharing class Controller {
    public String Name;
    public String FatherName;
    public void show(){
       List<Registration__c> Reg = new List<Registration__c>();
        for(Registration__c obj :[select id, Father_s_Name__c,Name from Registration__c])
        {
          Reg.add(obj); 
        }
        Name = Reg.Name;
        FatherName = Reg.Father_s_Name__c;
    }
}
Problem:
Variable does not exist: Name.
Variable does not exist: Father_s_Name__c.
1 in line 0 of Registration page