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
James HayesJames Hayes 

Embedded visualforce link open in new window

Hey All, 

I have embedded a VF page into the home screen that allows our sales users to inline edit their opportunities.  However, when they click on the opportunity name, it opens the opportunity in the embedded window and I would like it to open it up in a new tab.  The code is below, can I get some assistance on how to do this? 

Appreciate all the help!
 
<apex:page standardController="Opportunity" recordSetVar="opportunities" 
              tabStyle="Opportunity"
    sidebar="false">
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlock >
                <apex:panelGrid columns="2">
                    <apex:outputLabel value="View:"/>
                    <apex:selectList value="{!filterId}" size="1">
                        <apex:actionSupport event="onchange" rerender="opp_table"/>
                        <apex:selectOptions value="{!listviewoptions}"/>
                    </apex:selectList>
                </apex:panelGrid>
            </apex:pageBlock>

            <apex:pageBlockButtons >
            <apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;">
            </apex:commandLink>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!opportunities}" var="opp" id="opp_table">
                <apex:column headerValue="Opportunity Name">
                <apex:outputLink value="https://ap2.salesforce.com/{!opp.Id}" id="theLink">{!opp.name}</apex:outputLink>
                </apex:column>
                    
                <apex:column headerValue="Stage">
                    <apex:inputField value="{!opp.stageName}"/>
                </apex:column>
                <apex:column headerValue="Sub Stage">
                    <apex:inputField value="{!opp.Deal_Desk_Sub_Stage__c}"/>
                </apex:column>
                <apex:column headerValue="Implementation Date">
                    <apex:inputField value="{!opp.Implementation_Kick_Off_Date__c}"/>
                </apex:column>
                <apex:column headerValue="Date of Demo">
                    <apex:inputField value="{!opp.Date_of_Demo__c}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Best Answer chosen by James Hayes
Deepak GulianDeepak Gulian

Replace 23rd line with this

<apex:outputLink value="https://ap2.salesforce.com/{!opp.Id}" target="_new" id="theLink">{!opp.name}</apex:outputLink>