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
Waqar Hussain SFWaqar Hussain SF 

I am not getting fields in vf page. can anyone help me?

This is my vf page
<apex:page controller="MailBouncedController"  sidebar="false" Showheader="false" id="pg">
    <!-- Import Necessary Jquery js File and StyleSheets-->
    <apex:includeScript value="{!URLFOR($Resource.jQuery, 'js/jquery-1.6.2.min.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.jQuery, 'js/jquery-ui-1.8.16.custom.min.js')}"/>
    <apex:includeScript value="{!URLFOR($Resource.jqPlugin, '/jquery.blockUI.js')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.jQuery, 'css/ui-lightness/jquery-ui-1.8.16.custom.css')}"/>
                    <script>
                function selectRecord(a,b)
                {                                     
                    window.opener.SetDonor(a,b);              
                    window.close();
                }
                function Exit()
                {
                    window.close();
                }             
            </script>
            <apex:pagemessages />
            <apex:form >
                <apex:pageblock >
                <apex:pageblockbuttons location="bottom">                     
                        <apex:commandbutton value="Exit" onclick="Exit();"/>
                    </apex:pageblockbuttons>
                    <apex:pageblockSection >
                        <apex:pageblockSectionItem >                  
                               <apex:outputpanel >
                                <apex:inputtext value="{!Searchstring}" style="width:130px"/>
                                <apex:commandbutton value="Search" action="{!SearchDonor}"/>
                             </apex:outputpanel>
                         </apex:pageblockSectionItem>
                     </apex:pageblockSection>
                     <apex:pageblockSection title="Contacts">
                    <apex:pageblocktable value="{!ConList}" var="Con" > <!--  rendered="{!ConList.size>1}" -->
                            <apex:column headervalue="{!$ObjectType.Contact.fields.Contact_ID__c.Label}">
            <!--       <apex:outputlink value="#" onclick="selectRecord('{!Con.Id}','Contact')">{!Con.Contact_ID__c}</apex:outputlink>
            -->       </apex:column>
          
                            <apex:column headerValue="Name">
                                    <apex:outputText value="{!Con.FirstName}"/>
                            </apex:column>
                          
                            <apex:column headerValue="LastName">
                                <apex:outputText value="{!Con.LastName}"/>
                            </apex:column>
                          
                            <apex:column headerValue="House No">
                                <apex:outputText value="{!Con.House_No__c}"/>
                            </apex:column>
                          
                            <apex:column headerValue="Building">
                                <apex:outputText value="{!Con.Sub_Building__c}"/>
                            </apex:column>
                          
                            <apex:column headerValue="Street" width="200%">
                                <apex:outputText value="{!Con.Street__c}"/>
                            </apex:column>
                          
                            <apex:column headerValue="Mailing City">
                                <apex:outputText value="{!Con.MailingCity}"/>
                            </apex:column>
                          
                            <apex:column headerValue="Post Code">
                                <apex:outputText value="{!Con.MailingPostalCode}"/>
                            </apex:column>
                          
                            <apex:column headerValue="State">
                                <apex:outputText value="{!Con.MailingState}"/>
                            </apex:column>
                          
                            <apex:column headerValue="Country">
                                <apex:outputText value="{!Con.MailingCountry}"/>
                            </apex:column>
                          
                     </apex:pageblocktable>
<!--                        <apex:outputpanel rendered="{!ConList.size==0}">
                            No records to display
                         </apex:outputpanel>
-->                     </apex:pageblockSection>     
                </apex:pageblock>
            </apex:form>
            
</apex:page>

and this is my controller...
public with sharing class MailBouncedController {

   // public String ConList {get; set;}
    public List<Contact> ConList {get; private set;}
    public string SearchString {get;set;}
    public string DonorName {get;set;}
    public string DonorAddress {get;set;}
    public Contact Donor {get;set;}
    public boolean showPopup {get; set;}
  
    public MailBouncedController(){
       //DonorName = 'Mr Syed Bilal Ali';
       //DonorAddress = '45 Bulding Sub Building Street London E17 8EN'; 
       Donor = new Contact();
    }
  
    public PageReference SearchDonor(){
        // List<Contact> ConList = new List<Contact>();
       // ConList = new List<Contact>();
        string s = SearchString + '*';
        try {
        List<List <sObject>> searchList = [FIND :s IN ALL FIELDS RETURNING  Contact(Id,Contact_ID__c,Account.Name,Email2__c,Email3__c,OtherPhone,Organisation__c,Street__c,
                                            Account_Number_2__c,Account_Number_1__c,MailingCountryCode,Building_Name__c,AccountId,IsPersonAccount,Sub_Building__c,Locality__c,
                                            House_No__c,Email,Salutation,MobilePhone,Phone,Firstname,LastName,MailingStreet,MailingCity,MailingPostalCode,MailingState,
                                            MailingCountry, AssistantName,AssistantPhone,Secondary_Email__c,Secondary_Last_Name__c,Secondary_Middle_Name__c,Prefix2__c )];
    
      
         ConList  =  ((List<contact>)searchList[0]);
         // system.debug(searchlist.size());
        //return null;
        if(ConList.size() > 1 )
                        {
                            showPopup = true;
                        }
            //return null;                    
       else if ( conList.size() == 1 ){
       DonorName = ConList[0].FirstName;
       DonorAddress = ConList[0].MailingStreet + ConList[0].MailingCity;
       showPopup = false;
                            
       }
      
       else if ( conList.size() == 0 ){
       apexpages.addMessage(new Apexpages.Message(apexpages.SEVERITY.info,'No matches found ! Try again'));
       showPopup = false;
                        }              

        }
      catch(Exception ex){
                       showPopup = false;
                       ApexPages.addMessages(ex);
                 }  
                  return null;
    }
  
}
Prafull G.Prafull G.
Waqar, What usre profile you are checking with?
Can you check the FLS of your custom fields on the profile. If you are not able to see the fields (assuming that there are no issues while loading) then setting up correct FLS should do it for you.
Waqar Hussain SFWaqar Hussain SF
I am cheking with sandbox
Prafull G.Prafull G.
ok. but what is the profile. System Administrator??
Go to your user details (your name > my profle > user details) and check the profile associated with user.

Then navigate to the profile. Locate the object and check Field Level security for all of the custom fields you are trying to display.