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
niharnihar 

My Task is to create Employee id card by using visualforce page can any one help me

My Task is to create  Employee id card by using visualforce page

such as image field,employee name field, employee code field, date field...............

can any one help for achiving it..........

Thanks in advance!!!
Best Answer chosen by nihar
SandhyaSandhya (Salesforce Developers) 
Hi,

I would suggest you work on below trailhead challenge to know the basics of visualforce.

https://trailhead.salesforce.com/modules/visualforce_fundamentals/units/visualforce_intro
 
Here is some sample code
 
<apex:page Controller="EmployeeController" >
  <!-- Page Header -->
  <apex:sectionHeader title="Employee Edit" subtitle="New Employee" />

  <!-- Begin Form -->
  <apex:form >
    <apex:pageBlock title="Employee Informations" mode="edit"> 

      <apex:pageBlockSection columns="2" showHeader="true" title="Information"> 
        <apex:inputField id="firstName" value="{!emp.First_Name__c}" required="true" />
        <apex:inputField id="lastName" value="{!emp.Last_Name__c}"  required="true" />     
      </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
</apex:page>
 
public with sharing class EmployeeController {

    public ApexPages.StandardController controller; 


    Public Employee__c emp = new Employee__c();
    public Employee__c getemp()
    {
        return emp;
    }

    Public String First_Name {get; set;}
    Public String Last_Name {get; set;}  


    public EmployeeController(ApexPages.StandardController Controller)
    {
        emp = (Employee__c)Controller.getRecord(); 
        this.controller=Controller;  
    } 
    public PageReference save() {
      insert emp; 
      return null;
    }    
}

Please mark it as solved if my reply was helpful, it will make it available
for others as a proper solution.

Best Regards,
​Sandhya