• prabhavathi sharma
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
how to call the apex method in visualforce page. where I did mistake tell me. I am getting this Error: Unknown property 'Example.name
I wrote this code 

Apex code
public class Example 
{
    
    pubic string name;
    
    public string getName()
    {
        return name;
    }
    public void setName(string name)
    {
        this.name=name;
    }
    public pagereference show()
    {
        name='This is my name'+name;
        return null;
    }
}

Visualforce code

<apex:page controller="Example">
 <apex:form>
     <apex:outputlabel>Enter Name</apex:outputlabel>
     <apex:inputtext value="{!name}"/>
     <apex:commandButton value="click" rerender="one" action="{!show}"/>
     <apex:outputLabel id="one">{!name}</apex:outputLabel>     
 </apex:form>
</apex:page>


 
HI EVERYONE 

MY QUESTION IS write an apex class to return the values to visualforce page

I Wrote this example where I did mistake please tell me

APEX CODE
public class example1 {

     public Integar age;
     public Example1()
     {
         age=10;
     }
     public Integar getAge()
     {
         return age;
     }
     public string getName()
     {
         return 'krishna';
     }

}

VISUALFORCE PAGE
<apex:page controller="Example1">
<apex:outputlabel>{!age}</apex:outputlabel>
 <apex:outputlabel>{!name}</apex:outputlabel>
</apex:page>



 

Hello All, I'm having an issue with the Using Formula Field Challenge . I'm using the formula that Vivek provided to a solved question yesterday " TODAY()  -    DATEVALUE(LastModifiedDate) " but its been met with this error below when its been checked by the challenge " 

Challenge not yet complete... here's what's wrong: 
The 'Days_Since_Last_Update__c' formula field did not return the correct number of days between an Account’s Last Activity Date and today

Can anyone assist???