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
mike1051mike1051 

Close child window and redirect parent window..?


I am opening a POPup window..which i am opening a VF page onlclick of a custom button.I Want to close the child window and redirect the parent window to email author page with some parameters/

https://cs16.salesforce.com/_ui/core/email/author/EmailAuthor?doc_id=00Pf0000000x1HuEAI&p3_lkid=006f0000004fKcj


I know how to close the child window but can someone tell me to redirect the parent window

function myClose(){

    self.close();
    window.opener.location.href="/{!$CurrentPage.parameters.Id}";

    //you could also use self.close();   
    }


I would really appreciate.

Thanks
Vinit_KumarVinit_Kumar
I am assuming you need to redirect to Opportunity record,if that is so,try below code :-

function myClose(){

    self.close();
    window.opener.location.href="/{!$CurrentPage.parameters._lkiId}";

    //you could also use self.close();   
    }

If this helps,please mark it as best answer to help others :)
mike1051mike1051
Thanks for answering but i need to redirect to Standard Email functionaity of Salesforce on oncomplete.

https://cs16.salesforce.com/_ui/core/email/author/EmailAuthor?doc_id=00Pf0000000x1HuEAI&p3_lkid=006f0000004fKcj
Vinit_KumarVinit_Kumar
How will you get the ids to redirect I mean 00Pf0000000x1HuEAI and 00Pf0000000x1HuEAI..
mike1051mike1051
I will get the ID's from controller.Now its static.Its like save and email quote.The window will get closed and it will be redirected to Salesforce Email Page.

Hope you understand
Vinit_KumarVinit_Kumar
Mike,

It's bit confusing for me.If you are getting the Ids from controller how will you get that in your JS function coz the JS function is gtting id from URL.

Also,you should usen Pagereference method to redirect if the ids are in controller.

Hope thi helps !!