Find your content:

Search form

You are here

What the best way to store data from Javascript in "salesforce"

 
Share

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.


Attribution to: Cilvic

Possible Suggestion/Solution #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.


Attribution to: pjcarly
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4024

My Block Status

My Block Content