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

I want to display listview count based on current user

Can you please help me to display list view count in the vf page.

public with sharing class pipeLineController {

public Integer unread{get;set;}
private Lead lead;
private User user;
private Opportunity opp;

 public Void LeadListValues()
            lead = [Select Id,,status from Lead];
            user = [select id,firstname from user where id=:userinfo.getuserid()];
            Id currentUserId = UserInfo.getUserId();
            unread = 0;
             AggregateResult[] groupedResultOAB =[SELECT count(Id)unread FROM Lead where IsUnreadByOwner = true and Owner.Id = :currentUserId and status IN ('Contacted by Aramex','Unread','Pending','Follow Up','Contacted')];        
            //    System.debug('groupedResultOAB = = '+groupedResultOAB);
            unread=Integer.valueof(groupedResultOAB [0].get('unread'));
<apex:page Controller="pipeLineController"  sidebar="false" >

        .bal, .bal td,.bal th {    
            border: 1px solid #ddd;        
            border-collapse: collapse;
            width: 100%;
        .bal th, .bal td {
            padding: 5px;
            background-image: url(/img/help/helpOrbs.gif); 
            background-repeat: no-repeat; 
            width: 16px; 
            height: 15px; 
            background-position: right; 
            vertical-align: middle;
            background-image: url(/img/help/helpOrbs.gif); 
            background-repeat: no-repeat; 
            width: 16px; 
            height: 15px; 
            vertical-align: middle;

body #bodyCell .bResource .secondaryPalette, 
body .secondaryPalette.bPageBlock, 
body .individualPalette .secondaryPalette.bPageBlock, 
body .bodyDiv .genericTable, 
body .genericPageBlockTable, 
body .bodyDiv .bSubBlock, 
body .bComponentBlock .bPageBlock, 
body .bMyDashboard .bPageBlock,
body.rlHoverFrame .bPageBlock,
body.subjectSelectionPopup div.choicesBox,
body.lookupTab .secondaryPalette.bPageBlock,
body.popupTab .secondaryPalette.bPageBlock,
body.UserTagStatsPage .secondaryPalette.bPageBlock {

    background-color: white;

    border-bottom: 1px solid black;

    border-left: 1px solid black;

    border-radius: 4px 4px 4px 4px;

    border-right: 1px solid black;

    border-top: 5px solid BLUE;


<apex:form >
 <apex:pageBlock title="welcome back {!$User.LastName}, follows your pipelines" tabStyle="account" >
<apex:pageBlockSection title="Leads" collapsible="true" >

  <table class="bal" style="width:100%">    
            <!-- <th>List Name</th>
            <th>Values</th> -->
            <apex:outputText value="{!unread}"> </apex:outputText> 
                 <a href="/00Q?fcf=00B0C000000yzUH" target="_blank">Unread
                 <a href="/00Q?fcf=00B0C000000yzUH" target="_blank">O




Thanks in Advance!!!
ANUTEJANUTEJ (Salesforce Developers) 
Hi SFDC_bi,

I think you can get the profile of the current user and according to which you can render your logic.

You can use {!$Profile.Name} or {!$Profile.Id} to check for profile.


Hope this helped you please close the thread by marking a best answer so that it is useful for others in the future and also helps in keeping the community clean.