1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    developer-greenova is on a distinguished road

      0  

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

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    developer-greenova is on a distinguished road

      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...?

Thread Participants: 1

Tags for this Thread