You need to sign in to do that
Don't have an account?

Calling a javascript function from a visualforce page
Folks,
Anyone know why I would be getting an Invalid Session error when I try to call a javascript function from an onclick event in the my Visualforce page. The javascript function has a data call using the sforce.connection.query syntax. Everytime I test fire my onclick event, I get a popup error on my VF page stating that the Invalid session...Illegal session and some other text....
Any help is greatly appreciated...
Thanks
Anyone know why I would be getting an Invalid Session error when I try to call a javascript function from an onclick event in the my Visualforce page. The javascript function has a data call using the sforce.connection.query syntax. Everytime I test fire my onclick event, I get a popup error on my VF page stating that the Invalid session...Illegal session and some other text....
Any help is greatly appreciated...
Thanks
Bind action attribute to a controller method. Let the controller method call the SOQL.
One reason is to do a dynamic SOQL query. VF controllers don't appear to support this yet.
NOTE from salesforce: Please do not use this suggested approach to establishing the ajax toolkit session - see reply from dchasman for the supported mechanism<script type="text/javascript">__sfdcSessionId = '{!$Api.Session_ID}'</script>The Ajax toolkit references this. Drop this into your VF page near the top to have the same functionality. For some reason connection.js seems to already be included in VF pages.
Keep in mind that this could break in later versions of the toolkit, especially since connection.js is automatically included.
There are a few very specific use cases where a hybrid VF/Ajax toolkit app is a more optimal design pattern.
Message Edited by dchasman on 07-08-2008 08:04 AM
I researched the inclusion of connection.js (that was a surprise to me) and tracked it back to the System Log functionality - going to see about getting that dependency removed asap (could definitely result in some undesirable behavior).
Chris - can you elaborate on your statement "There are a few very specific use cases where a hybrid VF/Ajax toolkit app is a more optimal design pattern."? From a Visualforce perspective we are working to remove all need for the ajax toolkit and I would very much like to hear about any specific use cases where the hybrid is still the opti
Message Edited by dchasman on 07-08-2008 08:01 AM
Thanks,
I am developing a Visualforce page that would need to access the EMAILSTATUS object and related Contact objects and display them in a report format. This is currently available as the "HTML Email Status report". I could not modify that. Neither does SF expose this object for reporting purposes.
It is available only via the Ajax API.
How would I get a VF controller to access this object and print all the join records between EMAILSTATUS and Contact objects?
Andi Giri