function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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