Posted 6 months ago
Sencha App with Salesforce API using a Sinatra Proxy
In my last article, I have presented Sencha Framework and some advantages this product got over other Mobile solutions. Convinced that I had a wonderful tool into my hands I have decided to create a simple app. The aim is to have two tabs. First one with an intro page, second one with a list of Leads retrieved through the Salesforce REST API. The list must be sorted and provide basic interaction by displaying additional details of a selected Lead.
As soon as you start playing with mobile application and a remote API you have to face a common javascript limitation: the Same Origin Policy. I invite you to read the Wikipedia article if you want to know more about that rule. Briefly, “The policy permits scripts running on pages originating from the same site to access each other’s methods and properties with no specific restrictions, but prevents access to most methods and properties across pages on different sites”. Said differently, you’re cute javascript mobile application hosted under xyz.com domain _can not_ request any data from salesforce.com domain. Such a shame but so imperative to keep the web safer.

It’s today a common statement to affirm that hegemony of monolithic relational database system is ending.