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
Jim ZhanJim Zhan 

AJAX 8.0 Toolkit doesn't work?

Code:
<html>
<script src="/soap/ajax/8.0/connection.js"></script>
<script type="text/javascript">
function setup() {
 var callback = {onSuccess: display, onFailure: failed};
 var userInfo = sforce.connection.getUserInfo(callback);
}

function display(userInfo) {
 var doc = document.getElementById("name-span");
 doc.innerHTML = userInfo.userName;
}

function failed(error) {
 document.getElementById("name-span").innerHTML = error.toString();
}
</script>

<body onload="setup()">
 Hi there! <span id="name-span"></span>
</body>

</html>

 


I then got such an error:
Code:
An error has occurred: {faultcode:'sf:INVALID_SESSION_ID', faultstring:'INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session', detail:{fault:{exceptionCode:'INVALID_SESSION_ID', exceptionMessage:'Invalid Session ID found in SessionHeader: Illegal Session', }, }, }

Any help will be appreciated, thanks in advance & happy new year to all.

Doug ChasmanDoug Chasman
Jim,

How are you invoking the target scontrol (how is the link to the scontrol being constructed)?

I expect the issue here is that the auto session establish support (disabled by default (for compatability reasons) if you create the link in your own code (perhaps via the HYPERLINK() function in a formula field) needs to be requested.

If you add the query parameter ic=1 to the url then auto session establish should kick back in.

BTW we are aware of this issue and have been discussing the possibility of making ic=1 the default again (the sticky part is the backward compatability issues).

Doug

Message Edited by Doug Chasman on 01-02-2007 08:11 AM

Jim ZhanJim Zhan
A million thanks to you, Doug. Adding the parameter to the formula field did solve my problem. :smileyvery-happy: