Results 1 to 3 of 3

Thread: Connecting Salesforce.com from a Sencha or ExtJS App??

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default Connecting Salesforce.com from a Sencha or ExtJS App??

    To SenchaTeam,

    I have been hitting my head all around to connect to a Salesforce.com instance from within a Sencha 2.0 App. I tried using the following 2 approaches
    1. SF AjaxToolkit : http://www.salesforce.com/us/developer/docs/ajax/Content/sforce_api_ajax_introducing.htm
    Here i tried using both 'sforce.connection.login( )' and 'sforce.connection.remoteFunction( )'

    2. Force.com Rest: https://github.com/developerforce/Fo...t-REST-Toolkit

    While the 1st approache throws a "Cross Domain" exception, the second one requires hosting of Proxy.php used to route the REST API Calls again to avoid "Cross Domain" issue.

    I am intending to build a Sencha Touch2.0 Mobile App, so i may not be able to host a local proxy.php within the Mobile container (please correct me if my understanding is wrong).

    Can you please guide me with a workaround or approach to connect to Salesforce.com with either of the above 2 approaches? Anything else which can help me authenticate the Salesforce instance and query data from the same would be Welcome.

    Regards,
    CP
    Last edited by developer-greenova; 14 May 2012 at 7:46 PM. Reason: Need to add some more details

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    If you are getting a cross origin error then the server doesn't support CORS. You have 3 choices, have the server support CORS (which you don't have control over), have the server support JSONP (which the server may not) or have your own server side code that won't have cross origin issues.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Can you pls elaborate the 3rd option of own server code?

    To keep it simple, how do i connect to salesforce? Can you share some sample Sencha code demonstrating the same...?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •