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
mohammadd ismailmohammadd ismail 

details in a pop up

how to view details of a record in a pop up window in a visualforce page

thanks in advance
Best Answer chosen by mohammadd ismail
NagendraNagendra (Salesforce Developers) 
Hi Ismail,

Please find the below code snippet for the visual force page
<apex:page standardController="Account" recordSetVar="accs">
  <apex:pageBlock >
    <apex:pageBlockTable value="{!accs}" var="acc">
      <apex:column headerValue="Action">
         <apex:outputLink title="View detail in a popup window" onclick="return openPopup('{!acc.Id}');">Details</apex:outputLink>
      </apex:column>
      <apex:column value="{!acc.Name}" />
      <apex:column value="{!acc.Industry}" />
      <apex:column value="{!acc.Type}" />
    </apex:pageBlockTable>
  </apex:pageBlock>
  <script>
    function openPopup(id)
    {
        var newWin=window.open('{!$Page.Popup}?id=' + id, 'Popup',
               'height=600,width=650,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
       
    }
  </script>
</apex:page>

Please make sure to mark this post as solved if it helps.

Best Regards,
Nagendra.P

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Ismail,

Please find the below code snippet for the visual force page
<apex:page standardController="Account" recordSetVar="accs">
  <apex:pageBlock >
    <apex:pageBlockTable value="{!accs}" var="acc">
      <apex:column headerValue="Action">
         <apex:outputLink title="View detail in a popup window" onclick="return openPopup('{!acc.Id}');">Details</apex:outputLink>
      </apex:column>
      <apex:column value="{!acc.Name}" />
      <apex:column value="{!acc.Industry}" />
      <apex:column value="{!acc.Type}" />
    </apex:pageBlockTable>
  </apex:pageBlock>
  <script>
    function openPopup(id)
    {
        var newWin=window.open('{!$Page.Popup}?id=' + id, 'Popup',
               'height=600,width=650,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
       
    }
  </script>
</apex:page>

Please make sure to mark this post as solved if it helps.

Best Regards,
Nagendra.P
This was selected as the best answer
mohammadd ismailmohammadd ismail
thanks for the help nagendra.