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

faultcode:'sf:Invalid_session_id' error in custom component inside visul force page


I want to delete Tag when user click on tag name from visual force custom component while Edit tag.

Here is my code.

<script src="/soap/ajax/14.0/connection.js" type="text/javascript"></script> 
<script language="JavaScript1.2" src="/js/functions.js"></script> 
<script type="text/javascript" language="JavaScript1.2">
function foo(tag){
var delResult = sforce.connection.deleteIds([tag]);
  if (delResult[0].getBoolean("success")) {
alert("Tag with id " + result[0].id + " deleted");
} else {
alert("failed to delete Tag " + result[0]);
<apex:repeat value="{!accountTags}" var="accountTag" id="theList1">
<span class="tag">
<FONT color="#FF0000" >
<span class="tagRemove" title="Remove tag {!accountTag.Name}" onclick="foo('{!accountTag.Id}');">X</span>

Here I am getting faultCode:'sf:Invalid_session_Id' exception.

Can you point me how to work this script or how I can send this request to contrller and remove the Tag from Salesforce database.

My probllem is I don't know how to send accountTag.Id to controller when user click on that tag so in contrller I cna remove this Tag.

So I place ajax call in component it self so I don't need to call controller and send tag Id to controller.

-Any suggestion?



You had also asked this in another post and I've already posted a reply there.