Activity Forums Salesforce® Discussions How to call Salesforce Apex class using javascript?

  • shariq

    Member
    September 23, 2018 at 7:31 am

    Check the below code.

    Apex Class:

    global class ClassName{

    webService static String methodName(String camName) {

    Campaign cam = new Campaign(name = camName);

    return cam.name;

    }

    }

    Java Script:

    var Campaign = sforce.sObject(“Campaign”);

    var String = sforce.apex.exceute(“ClassName”,”methodName”,{name=”ABC”});

  • Parul

    Member
    September 23, 2018 at 7:39 am

    Using Remoting action and action function.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos