Other major issue with Remoting was regarding namespace prefix handling in prefixed and non-prefixed orgs, a couple of scenarios for that could be:
- Unmanaged Packages: Development started in an un-prefixed DE org, and later the package is deployed to other orgs having prefix. Typically this is case with reusable components with in a company, for ex. we developed a pretty cool remoting based charting component to be reused across different consulting projects. But different org prefixes and ISV packages troubled a lot.
- Managed Package: ISV team started development started again in a vanilla DE org with no prefixes for namespace, later the same package was pushed to various orgs like QA, UAT and packaging, each having either no prefixes or one.
Solving the namespace prefix problem
We have two solutions available
1. Pre Summer’12 release
2. Post Summer’12 release
Using remoting is made way easier now, namespaces are handled in similar way like pages, labels etc i.e. a Global variable named “$RemoteAction” is introduced for namespace resolution. It works in pretty much the same way as of $Page or $Label variable, by handing package isolation automatically. So we don’t need to use above pre summer’12 work around any more.
A good example on how to use $Remoteaction is available in official visualforce guide here: http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm