Newer Version Available

This content describes an older version of this product. View Latest

Declaring a Remote Method with Interface Parameters

You can declare @RemoteAction methods with interface parameters and return types, instead of being restricted to concrete classes. With interface parameters and return types, a package provider can package a remote method and associated interface, which subscriber orgs can call from Visualforce pages. Subscriber orgs pass in their own class that implements the packaged interface.

If a @RemoteAction method is in a managed package and used by Visualforce Remoting, it must have global visibility if user profile or permission set access is used.

Note

Here’s a brief example:
Objects sent from a JavaScript remoting call to a @RemoteAction that declares interface parameters must include an apexType value, which must be a fully qualified path to the concrete class, that is, namespace[.BaseClass][.ContainingClass].ConcreteClass. For example, to make a JavaScript remoting call to RemoteController:
If the class definition is within your organization, you can simplify the remoting call and use the default c namespace: