Code Walhalla ... Avatar

Posts tagged salesforce

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.

Continue reading…

Ruby External CRON manager for Salesforce on Heroku

In todays post we’ll have look at task scheduling using Heroku and the famous Resque gem. I have presented it at last London Skillsmatter Salesforce Dev Meetup. Watch the video: Delayed tasks on Salesforce have some well known weaknesses. For example: “Use extreme care if you are planning to schedule a class from a trigger. You must be able to guarantee that the trigger will not add more scheduled classes than the 25 that are allowed”. With the help of Heroku, most of your background tasks might be externalized and delegated to a dedicated app on Heroku. To build that solution we’ll be using 4 different gems. The objective is to create a simple web app that is able to create, handle and monitor tasks build by registered users. To be really functional, that web app should be reachable through an API (coming in a future post).

  1. Sinatra to build a basic web app
  2. Databasedotcom: to get the secure connection to Salesforce API
  3. Omniauth to get the authorization token from your ORG
  4. Resque to handle Job Queues and monitor them

Continue reading…

Monolithic Databases are dead

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

ORM, Object Relation Model, were the last trial to perpetuate that pattern born in the 70’s. ORM bring to software development specialist the sweet feeling of directly interacting with objects. In Ruby on Rails world, Active Record was a wonderful implementation imposing its conventional relational approach on all web developer. In “Java world”, Hibernate has still a massive user base but controversy about its performance and ability to handle some complex situation are numerous.

Long story made short, Relational Databases persist data. That’s a fact as for all storage systems but they also structure the way we represent and organize our data model. They oblige us to think them through principles such as cardinality, relation entity, foreign keys and all those typical normalized form concept Entity Relationship Model. Furthermore, well know performance might quickly be an issue when mixing ORM and relational Databases. You want to make a query with 15 joins to display a deeply structured data set with few conditions and limit? You should rethink it.

Continue reading…

When Salesforce meets awesome Ruby gems

There are multiple ways to connect your app to a SalesForce account but this one is pretty elegant and modern as it uses the new Winter ‘11 release with support of OAuth2 authorization standard through Omniauth. This article also describe the built of a REST API using HTTParty awesome gem.

Why we, Rubyists, care about Salesforce-Heroku?

Everybody might have heard in our Ruby/Rails technosphere that recently, the successful company Salesforce.com, famous for his platform, his growth and his position as the first huge Cloud business oriented app, has bought the tiny and innovative Heroku Platform.

I am not going to give an introduction about what those two key cloud actors do. You have to know that already. I am here to explain why the CRM market leader decided to buy our underground Ruby on-demand hosting platform and why that matter for us. 

Continue reading…