• Jatin Bansal 18
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

I have requirement to display only specific related list(License in this case) in VF. I tried using following code but no success. I am using apex:details to hide all related list and then apex:related list to show specific related list. I need to know 2 things:-
  • Why this code is not working ?
  • Is there a better way to approach this problem ?
<apex:page renderAs="pdf" showHeader="false" applyHtmlTag="false" applyBodyTag="false" controller="FulfillmentRequestListViewPdfExtension" action="{!updateDistributionStatus}">
<html>
    <head>
        <style>
            @media print {
                html, body {
                    height: 99%;
                }
            }
        </style>
    </head>
    <body>
        <apex:repeat value="{!frs}" var="fr" id="theRepeat">
            <apex:detail subject="{!fr}" id="theValue" relatedList="False" />
            
             <apex:relatedList list="Licenses__r">
              <apex:facet name="header">License Details</apex:facet> 
             </apex:relatedList>
            
               <div style="page-break-after: always;" />
        </apex:repeat>
    </body>
</html>
</apex:page>

License Object (Related List)