Also refer below link. https://salesforce.stackexchange.com/questions/30253/control-the-target-window-of-outputfield-if-a-link ​   Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.                                               Best Regards Sandhya  ", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T43BjSAJ", "datePublished": "2018-08-28T15:57:18.000Z", "author": { "@type": "Person", "name": "Sandhya Reddy Kasarla", "url": "https://trailblazers.salesforce.com/profileView?u=0053A00000E3HWGQA3", "affiliation": { "@type": "Organization", "name": "--" } } } ] } }
Skip to main content
Hi, I am an Administrator who is starting out in Visualforce and just needs help with this; 

I created a visualforce page that shows the related list of a custom object; Here is what I used; 

<apex:page standardController="Account_Plans__c">

<apex:pageBlock >

<apex:pageBlockTable value="{!Account_Plans__c.Key_Contact_and_Objective__r}" var="Key_Contact_and_Objective">

 <apex:column headervalue="Key Contact and Objective"><apex:outputLink value="/{!Key_Contact_and_Objective.id}">{!Key_Contact_and_Objective.Name}</apex:outputLink></apex:column>

  <apex:column value="{!Key_Contact_and_Objective.Key_Contact_Name__c}  "/> 

  <apex:column value="{!Key_Contact_and_Objective.Contact_Title__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Hugrank__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Hugrank_Score_Increase__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Pardot_Score__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Pardot_Score_Increased__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Pardot_score_date_updated__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Relationship_Lead__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.What_they_care_about__c}"/>

  <apex:column value="{!Key_Contact_and_Objective.Role__c}"/>

</apex:pageBlockTable>

</apex:pageBlock>

</apex:page>

The issue with this is - When I am clicking on Lookup values (Accounts related and Account plan name) they are opening the same component that I created and is not opening a new tab. 

Question: What Can i do to make any lookup clicks open in a new tab?
1 answer
  1. Aug 28, 2018, 3:57 PM
    Hi,

    You can try with below code.

     

    <apex:inputField value="{t.owner}" id="ownerId"/>

    <script>

    document.getElementById('{!$Component.ownerId}').target = "_blank";

    </script>

    Also refer below link.

    https://salesforce.stackexchange.com/questions/30253/control-the-target-window-of-outputfield-if-a-link

     

    Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.

                                                 

    Best Regards

    Sandhya

     
0/9000