+ Start a Discussion

Start Apex-Code with button



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) 

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.