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
lalilali 

want to perform certain code only after closing the window that was opened from a javascript

Hi, I have a button with the folllowing code which will open a window and after closing that window, I want to perform some action based on the return value of that window. Can anyone pls help on how to acheive that ?

{!requireScript("/soap/ajax/28.0/connection.js")} 
{!requireScript("/soap/ajax/28.0/apex.js")} 

var childWin;

if ('{!Equipment_Request__c.Equipment_Type2__c }' == 'CSP-CM')
{
  window.open('/apex/VF_TechnicalSurvey_Signature_Capture?Id={!Equipment_Request__c.Id}');

}

//after closing the window that was opened above, I want to perform the following code

var contract = new sforce.SObject("Equipment_Request__c");
var retStr;
var pageName = "vf_SignatureCaptured";

retStr = sforce.apex.execute("SE_ER_Coffee_PDF", "savePdf", {
ERId : '{!Equipment_Request__c.Id}',
pageName : pageName
});
John PipkinJohn Pipkin
Check out this article: http://stackoverflow.com/questions/1777864/how-to-run-function-of-parent-window-when-child-window-closes