• Tridib Chattopadhyay
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi All,
I am new in salesforce world and trying to learn as much as I can. While playing around with VF page and Apex class controller I am stuck at one place. I am sharing the details here with code and scenario what I want to achieve. Hope I will get some help here -

Scenario : I want to create a button on VF page and once I click the button it should show me the records on my custom object in blocktable format.
I am able to do and see result thru SOQL and also when I am trying to display the data directly on the VF page ( without button) it showing fine. But I want when I click then only it should show the data n VF page.
Custom object Name : Employee__c

Apex Class code :-
public class EmployeeClass
{

    public PageReference myemps() {
        return null;
    }

    List <Employee__c> emp = [select Name,Salary__c,Skillset__c,Employee_ID__c from Employee__c ] ;
    
    public  List <Employee__c> getmyemps()
    {
        return (emp);
    }
     
}

VF Page code : 

<apex:page controller="EmployeeClass">
        <apex:form >
            <apex:pageBlock >
                  <apex:commandButton value="ListButton" action="{!myemps}" />
                      
              <apex:pageBlockSection >
                      <apex:pageBlockTable value="{!myemps}" var="i">
                                <apex:column value="{!i.Name}"/>
                                  <apex:column value="{!i.Salary__c}"/>
                                <apex:column value="{!i.Skillset__c}"/>
                                    <apex:column value="{!i.Employee_ID__c}"/>
                    </apex:pageBlockTable>  
                
              </apex:pageBlockSection> 
             </apex:pageBlock>
        </apex:form>
</apex:page>
Current code output
 

Hello, how to set fiscal year in DevEd?

Error message:
"Challenge Not yet complete... here's what's wrong: 
It doesn't appear that your company’s fiscal year has been set to start in February."

step-by-step please