• Mahesh Tandan
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all,
I have created one vf page and one custom controller.But whenever i am trying to save data it is not happening and also it is not showing any error.

Anyone help me on this.



Controller
public class EmployeeController
{
     
    
    public Employee__c abc{get;set;}
  
    

    public EmployeeController()
    {     
       abc = new Employee__c();

       
    //   abc = [Select id,Name,Birth_Date__c from Employee__c];
       
    }
    
  
    
    public PageReference save(){
        
        insert abc;
        return null;
        
    }
    
       
}



Vfpage
<apex:page lightningStylesheets="true" controller="EmployeeController" showHeader="false" standardStylesheets="false">


 <apex:pageBlock >    
        <apex:pageBlockSection columns="2">
             <apex:inputField value="{!abc.Name}"/> 
             <apex:inputField value="{!abc.Custom_Code__c}"/>      
        </apex:pageBlockSection>
            
        
               
            <apex:pageBlockSection title="Work Address">
                 <apex:inputField value="{!abc.Work_Address__c}"/>
                 <apex:inputField value="{!abc.Work_Address_Line_2__c}"/>
                 <apex:inputField value="{!abc.Work_City__c}"/>

                <apex:commandButton value="Save" action="{!save}" styleClass="slds-button slds-button_brand"/>
                
             </apex:pageBlockSection>
       </apex:pageBlock>

Thanks in advance