0

I'm writing a small analytics app in Javascript and want to store data in a database. Since I am new to salesforce I can't figure out the best way to do this:

  • a normal DB such as heroku (postgresql)
  • database.com (couldn't find much on how to access via JS)
  • force.com ?
  • APEX ?

Thanks for pointers.

Update: For now all the javscript is inside the code of the Home Page component.

  • If you don't have much use for CRM and would like a Postgres db, Heroku might be a better match. With salesforce you get a built in database and the Force.com platform to build apps. – techtrekker Nov 4 '12 at 19:49
  • @techtrekker thanks, it's a requirement to track usage of salesforce.com. Because the app needs to go into the appexchange I want to store the data as "close to salesforce" as possible, so I will look at Heroku! – Cilvic Nov 4 '12 at 19:53
  • The database.com API is identical to the Force.com API. – metadaddy Nov 5 '12 at 5:14
1

Normally you would want to do this by sending data via a REST call to your salesforce, you can create your own REST API functions in apexrest more about that here: http://www.salesforce.com/us/developer/docs/apex_rest/api_apex_rest.pdf In these apexrest functions you would handle the incoming data, store it in the database, do calculations, ...

The problem you have there is, you can't do cross domain rest calls, a solution here is either do the call from your webserver backend (via PHP or something else) or you include your javascript file directly from your salesforce.com domain where the rest call is being send to.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.