• sfox
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi,

i want to  create a custom action '{!toadd}' for customObject 'UserProfiles__c' in the vf page.

 

i hav written the following code:

 

/* visualforce page  */

<apex:page standardController="UserProfile__c" extensions="LeaveAppClass">
    <div align="center" style="font-family:forte;font-size:18pt;color:brown;background:wheat">
        <h1>Leave Application</h1>
    </div><hr/>
    <apex:form >
        fromadd :{!UserProfile__c.emailID__c}<br/>
        toadd :{!toadd}<br/>
        subject :<apex:inputtext id="subject" size="40"/><br/>
    </apex:form>
</apex:page>

 

/* Extension class LeaveAppClass */

public class LeaveAppClass
{   
    ApexPages.StandardController con;
    public LeaveAppclass(ApexPages.StandardController controller)
    { 
        con = controller;
    }
    public String toadd()
    { 
        String emailID;
        Userprofile__c ucon = [select emailID__c from Userprofile__c where Role__c =: 'HR'];
        hremailID = ucon.emailID__c;       
        return emailID;       
    }
}

 

I am getting an error as:

ErrorError: Unknown property 'UserProfile__cStandardController.toadd' 

 

what could be the problem. I am new Visualforce and apex....help me

HI All,

 

string res = 'I ' m a Apex Dev.';

 

how to replace single quote(') to \'.

this value send to visual force page javascript validations.

 

Regards

Ravi