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
d.tejdeep@nicomatic.ind.tejdeep@nicomatic.in 

How to close and the open the same page?

i have same requirement what your are discussing about

<apex:commandButton value="Search Again" onclick="return window.open('/apex/customreport');window.top.close();" />

it is opening one new window and the old window is also there .

when the button is clicked it has to close the current window and apen the new window which i wrote above .answer would be great helpful
Ashish_SFDCAshish_SFDC
Hi , 


<apex:page >
    <script type="text/javascript">
        window.close();
    </script>
</apex:page>


Regards,
Ashish
Satish_SFDCSatish_SFDC
Try using window.close() after opening the new window.

Regards,
Satish Kumar