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
SelvaSelva 

invalid session while updating the agreement field from child window.

Hi,

I am trying to implement the logic to update the agreement object from child window(modal dialog window).

 

I've create two S-controls one is parent window and another is child window which displays some check box fields. when clicked on save button from child window, it should update the fields in corresponding agreement object and come back to parent window.

I've marked a couple of fields. When clicked on the Save, received the following error:

 {faultcode:'sf:invalid_session_id; faultstring:"Invalid_sesssion_id:Invalid session ID found in sessionheader: Illegal session'. This only happened  one time

 

Parent s-control :

 

returnval = window.showModalDialog("{!URLFOR($SControl.tocChild, tocApprovalRequest__c.tocObjectId__c)}" ,'Approval Screen','dialogWidth:900px;dialogHeight:640px;resizable:no;toolbar:no;status:no;center:yes;help:no;');

 

Child S-control

var result2=sforce.connection.update([agreementObj]);

 

Please provide me hint, what could be the reason for this error.

 

Awaiting for the reply soon.

devNut!devNut!
You might try calling an update method on the parent window from the child window.
SelvaSelva

Yes i did! :-)

I couldn't find any other way to avoid this. Becaz i need to open up the pop-up screen(child window) which brings the updated value been displayed there ,then click on Save , it should update the agreement object from the child and set the below stmt

window.returnValue = "Save";

window.close();

Then once control comes back to parent window, it would check the value, if it is Save, then top.location.replace("AgreementId")

I should have to update from child window only, otherwise i need to change the whole logic which would spoil my deadline! :-(

SelvaSelva
I've tried to implement the session handling in the parent window by using the below code, but it is failed
 function init()
 {
  //1. Log in
  sforceClient.useCookies = true;
  sforceClient.registerInitCallback(login);
  window.setTimeout("doInit();", 50);
 }
 function login()
 {
   var sessionId = login(); 
    if (sessionId != null) {
    sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}", true);
    }
 }

Is there any other way to avoid this error ?

 

Plz help me

 


SelvaSelva
 If i checked off the "lock sessions to originating IP" check box which is under Setup->Secutity Controls->Session Settings, then would it solve this problem?
 
Again, it happened with only one user who performed action on my child window created by  s-control