• #37392
    Salesforce | Aman Aman #4

    How to call Salesforce Apex class using javascript?

    How to call Salesforce Apex class using javascript?


    • This topic was modified 4 months ago by Salesforce | Aman Aman.
    • This topic was modified 1 week, 6 days ago by Salesforce | Team Team.
    Salesforce | shariq shariq #1

    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”});

    Salesforce | Parul Parul #2

    Using Remoting action and action function.

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.


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 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?