Activity Forums Salesforce® Discussions How can you call a controller method from JavaScript in salesforce?

  • Suraj

    Member
    April 18, 2017 at 2:12 PM

    Hi Saurabh,

    You need to use apex:actionFunction within vf page and define “action” attribute to Function to call. For e.g

    <apex:actionFunction action=”{!login}” name=”login”/>

    here action=”{!login}” is my function name to call and within javascript call name attribute within actionfunction according to your condition.

    hope this will help you.

Log In to reply.