You need to sign in to do that
Don't have an account?
custom action for standardcontroller
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:
Error: Unknown property 'UserProfile__cStandardController.toadd' |
what could be the problem. I am new Visualforce and apex....help me
Hello shra1_dev
Change
to
-Suresh
All Answers
Hello shra1_dev
Change
to
-Suresh
thanks ssrs2..... but why need to mention 'get'.
please post the links to refer on that
I also have the same question. Why do we use the prefix 'get'?
It means we can't use our own name for a method?
:(
Hello shra1_dev;
Visualforce markup can use the following types of controller extension and custom controller methods:
for more info
pages_controller_methods.htm
-Suresh
thank u suresh......I'll refer those
You can also use Apex class properties (as described in the Apex Reference. In this case there is no get/set prefix added.