function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nurav1982Nurav1982 

Calling a non-global class's methods upon a custom button's onclick javascript

I know using sforce.apex.execute we can call methods from a global class.

But I would like to know whether it is possible to call methods from a public class.?

Ex:
public  class myClass {
  webService static Id makeContact(String lastName, Account a) {
        Contact c = new Contact(LastName = lastName, AccountId = a.Id);
        return c.id;
    }
}



Sonam_SFDCSonam_SFDC
It should be able to access the method in the public class (http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm)

Just wish to inform -  When using Webservice keyword - you should make the class global for this webservice to be available to be used by other clients.