function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Florian Marx05282918216679144Florian Marx05282918216679144 

SIte.com JavaScript Button to update SF Objects

Hi,

in a Site.com Page I added a Button with a simple onClick JavaScript to validate connection options to SF. Simplified code example for connection test:

{!requireScript("/soap/ajax/29.0/connection.js")}
var result = sforce.connection.login("<USR>", "<PWD>");
alert("Logged in with session id " + result.sessionId);

No success or error, testing with a simple Alert works fine.
Can you provide tips / hints?
Ashish_SFDCAshish_SFDC
Hi Florian, 


Need some more information on this post, 

Enable debug logs to see if you can see some clue - till which point it is going and where is it breaking. 

See the below links for related information , 


Authenticating Users on Force.com Sites

http://wiki.developerforce.com/page/Authenticating_Users_on_Force.com_Sites


Adding a visualforce page requires authentication in communities

https://success.salesforce.com/answers?id=90630000000hM1uAAE


Is it possible to use Customer Portal Authentication in Site.com (aka SiteForce)

http://salesforce.stackexchange.com/questions/82/is-it-possible-to-use-customer-portal-authentication-in-site-com-aka-siteforce


Regards,
Ashish