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
Matt HamptonMatt Hampton 

Custom Button Not Opening In New Window

I have created a VF page that has a custom button as a part of it. When I click the custom button, I want the new page to open in a new window. When I am logged in, this works. When other uses are logged in and the button is clicked, it opens the new page like it is embedded in the VF page.

 

Here is my code:

 

<apex:page standardcontroller="Wire_Center__c" tabStyle="Sites__c" extensions="RFMDU">
    <apex:pageBlock >
                <apex:pageBlockTable value="{!Sites}" var="zip" width="100%" columns="5">
                <apex:column id="c7">
                    <apex:form >
                    <apex:commandButton value="Assign" onclick="javascript&colon;openPopUpWindow;return false" action="/a1E/e?CF00NC0000005bqW8={!zip.name}&CF00NC0000005bqW8_lkid={!zip.id}"/>
                    </apex:form>
                </apex:column>                
                <apex:column id="c5" headerValue="MDU">
                    <apex:outputLink value="/{!zip.Id}" target="_top">{!zip.Name}</apex:outputLink>
                </apex:column>
                    <apex:column id="c4" headerValue="Last Resweep">
                        <apex:outputField value="{!zip.Date_of_Last_Resweep__c}"/>
                </apex:column>
                    <apex:column id="c3" headerValue="Current Penetration">
                        <apex:outputField value="{!zip.Current_Penetration__c}"/>  
                </apex:column>
                    <apex:column id="c2" headerValue="Non-Video Doors">
                        <apex:outputField value="{!zip.Non_Video_Doors__c}"/>                      
                </apex:column>          
                </apex:pageBlockTable> 
    </apex:pageBlock>
</apex:page>

Any thoughts?

 

Thanks in advance,

 

Matt

Best Answer chosen by Admin (Salesforce Developers) 
Saurabh DhobleSaurabh Dhoble

I've never seen the openPopupWindow function in javascript.

 

Try this :

onclick="window.open('/a1E/e?CF00NC0000005bqW8={!zip.name}&CF00NC0000005bqW8_lkid={!zip.id}');"

 

All Answers

sivaextsivaext

Hi

 

I think this happens because permission issues.

 

1. The other user are able to access that vF page

2. I seen in your code has harcode id's (salesforce id's) . May be the other user don't have access that records.

Saurabh DhobleSaurabh Dhoble

I've never seen the openPopupWindow function in javascript.

 

Try this :

onclick="window.open('/a1E/e?CF00NC0000005bqW8={!zip.name}&CF00NC0000005bqW8_lkid={!zip.id}');"

 

This was selected as the best answer