Activity Forums Salesforce® Discussions How to Add Javascript Remoting to VF page in Salesforce?

  • Laveena

    Member
    August 8, 2019 at 8:26 am

    Hi Achintya,

    To use javascript remoting in a Visualforce page, add the request as a javascript invocation with the following form:

    Syntax -

    [namespace.] controller.method ( [parameters ...] Call back Function, [configuration] );

    Thanks

  • Saddam

    Member
    August 9, 2019 at 6:11 am

    Hi Achintya

    You can't use apex method directly in javaScript, first of all, you will have to annotate your method with @RemoteAction

    after that, you call the apex method

    ex:

    Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.NameofApexClass.NameOfApexMethod}',

    you can pass parameters,

    callback function,

    )

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos