You need to sign in to do that
Don't have an account?
lali
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
});
{!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 Pipkin
Check out this article: http://stackoverflow.com/questions/1777864/how-to-run-function-of-parent-window-when-child-window-closes