+ Start a Discussion
mknobmknob 

Start Apex-Code with button

Hi.

 

I've already lerned how to create a button with Visualforce. Now i want to execute Apex-Code with a button. How i do this?
Best Answer chosen by Admin (Salesforce Developers) 
TehNrdTehNrd

PAGE: <apex:commandButton value="Click Me." action="{!doSomething}"/> Controller/Extension: public void doSomething(){ //execute code here }

I would highly recommed reading over the Apex and Visualforce Developer Guides if you have not done so already.

 

-Jason