Find your content:

Search form

You are here

I want to display my related list onl ywhen the list has records

 
Share

i want to display my relatedlist when the related list have records and i don't want to display my relatedlist when the related list has no records.

i have wriiten this code. I am not achiving my requirement in the pdf by this code can u people help me with this.

 <div id="Childs">
  <apex:relatedList list="bucketrate__r" title="Bucket Rate Factoring Fee" rendered="{!opportunity.bucketrate__r.size()>0}"/>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js">    </script>
   <script>
    $(document).ready(function(){
        $('#Childs a').attr('target','_blank');
    });
    </script>

..Error: Unknown function opportunity.bucketrate__r.size. Check spelling

Attribution to: user8176

Possible Suggestion/Solution #1

<apex:relatedList list="bucketrate__r" title="Bucket Rate Factoring Fee" rendered="{!opportunity.bucketrate__r.size>0}"/>

Try above. Its only .Size not method notation in Visualforce.

I would say to use JSENCODE or HTMLENCODE as security best practice when you are doing logic like that .


Attribution to: Mohith Shrivastava
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/34153

My Block Status

My Block Content