+ Start a Discussion

window.open in partner portal not open in parent URL

Hi All,


I have a simple JS function.

function openNewVfpage(){

return true;


it working in salesforce when I am clicking on button. but in portal I am using the same VF page and clicking on button and it opens only


but I need this URL with the parameter  ?searchText=value

it should be  



can anyone please help me out ?






Bhawani SharmaBhawani Sharma
Can you check the javascript console to check if you are getting any error?

Thanks for reply

Already I checked , there is no error in console. Even if error occured then it will be in salesforce VF page it self.

Bhawani SharmaBhawani Sharma
Alert box is working ?

Yes I had fix some alerts as well , and I am getting the exact URL in alert before calling it in window.open.



Bhawani SharmaBhawani Sharma
This is really odd. Did you try with hardcoded searchText? like

Yes Bhawani,


Almost I checked every probality even I tried to check other properties of windows like window.location.heref and all others but still not work. Ok fine.


Now again I am trying to write another button code and will try to open some other hard coded URL and lets see what happens. I know it is silly work but still some time we used to do :)



Its not working , I understood the problem. I have another commandLink or button on Portal Header as VF page in Iframe if I am clicking from header part it works for window.open but if we are in the portal VF page then the same code doesnot override the parent URL. 

Bhawani SharmaBhawani Sharma
Also did you try with parent.location.href?

Yes , I wrote in my previsous reply.



Bhawani SharmaBhawani Sharma
Surprised, why it's not working. I will try this my self and will getback to you




I have done my job using pagereference method. But still it should work with window.open.