You need to sign in to do that
Don't have an account?
Sridhar Jujjavarapu
How to call a apex class from button
Hi
how to call a apex class or method from botton click ,please give me sample code for that
Thanks in advance
Sri.
how to call a apex class or method from botton click ,please give me sample code for that
Thanks in advance
Sri.
Please check: http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualforce-page/
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Regards
This is a class:::
public class classname{
public objectname instance{get;set;}
public classname(){
instance =new objectname();
}// this will be allocate the memory
public void save(){
// you are write a logic here
}// this is a method
}
page:
<Apex:page controller="classname">
<Apex:form>
<Apex:pageBlock>
<Apex: commandButton value="Button" action="{!save}">
</Apex:pageBlock>
</Apex:form>
</Apex:page>
In this action attribute to invoke the method.
Is this my basic Knowledge.
Regards,
padma