+ Start a Discussion

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.?

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

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.