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
JayaJayaJayaJaya 

Is this possible?

In the standard Lead detail page in Service Console,  i have added a custom button, and  on click of that button i am opening a new popup window(visualforce) and after processing is done in Apex controller, the popup should be closed and parent lead detail page should be refreshed with another url. 

Please let me if the above can be achieved, if so, pls give me an example.  thanks. Jaya.

V AnandV Anand

It is possible to go to previous page after  Button action is performed. Let me know what kind of action you perfrom on button.

 

If you want to stay same page after action performed then you have to add some code to your controller . The code like this

 

PageReference PR;

ID CID;

 

In contructor you have to initialize CID to get present ID from URL

 

CID= Apexpages.currentpage().getparameters().get('id');

 

PR= new PageReference('/' + CID); 
         PR.setredirect(true);
         Return PR;


IF the above not meets your requiremnet then Let me know the exact requirement.

 

 

ryanjuptonryanjupton

You could also look at JavaScript remoting in VF. Have your VF page (the popup) call a function in the Apex controller via JavaScript. When you do this you also specify a callback that gets executed when the Apex function returns. I imagine in that callback, which is also JavaScript, you could do something like:

 

    window.opener.document.location.href = url;

     window.close();