apex:actionFunction & apex:actionStatus in Salesforce Visualforce Page

How to use apex:actionFunction and apex:actionStatus in Salesforce Visualforce Page?

How to use apex:actionFunction and apex:actionStatus in visualforce page ?

“apex:actionFunction :

It provides support for calling an apex method from JavaScript code using an AJAX request. An <apex:actionFunction> component must be a child of an <apex:form> component. An apex:actionFunction cannot be placed inside an iteration component <apex:pageBlockTable>, <apex:repeat>.” [1]

“apex:actionStatus :

A component that displays the status of an AJAX update request. An AJAX request can either be in progress or complete.” [2]

A snippet of code for the Salesforce Visualforce Page :


A snippet of code for the Salesforce Apex Controller :


Here are some screenshots which are showing our apex:actionFunction and apex: actionStatus. We have embedded our Visualforce Page in a section on an opportunity. The page will look like below screenshot :


On click of ‘Update Opportunity’ button, an apex action will call that update the opportunity.

apexfunctiondemo2 (1)


Here is a video that shows the working of apexfunction :

Look into the video before the click of  ‘Update Opportunity’ button the opportunity name was ‘Test opportunity’ and after a click of the button the name update to ‘Update Name’.


(1) http://sfdcsrini.blogspot.com/2014/06/how-to-use-apexactionfunction-in.html
(2) https://developer.salesforce.com/forums/?id=906F0000000kCGDIA2


Leave a Reply


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?