Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
could any one explain even though i wrote standard controlller 

 <apex:page standardController="japan__c" recordSetVar="jap">

    <apex:dataTable value="{!jap}" var="a">

        <apex:column value="{!a.name}" />

    </apex:dataTable>

</apex:page>

User-added image

i am unable to see Visualforce in page layout. do i need enable anything in specific . 
12 answers
  1. Aug 12, 2017, 5:11 AM
    Hi,

    A VisualForce page can only be added to an object's Page Layout if it declares the standardController attribute and its type must match(RecordSetVar should not there). I mean to say that you can not display ListController related VF in page layout. To check this concept, you please save the below VF in your instance then open page layout, it will be visible for you.

    <apex:page standardController="japan__c">

    </apex:page>

    However, if you want to display your list of records then you use extension controller then store your list of records into one of your Controller property then iterate that list property in your VF. 

    e.g.

    VF

    -----------------------

    <apex:page StandardController="Account" extensions="ExtController" readOnly="true">

    <apex:pageBlock >

       <apex:pageBlockTable value="{!esProjList}" var="eachSubProject" rendered="{!(subProjList.size != 0)}">

       </apex:pageBlockTable>

    </apex:pageBlock>

    </apex:page>

    // controller

    ----------------------------------

    public with sharing class ExtController {

        public static Account currentAccount;

        

        public List<ANYCUSTOMOBJECT> esProjList{

        get{

            if(esProjList==null){

                esProjList = [Select Id,Name,Owner.Name FROM ANYCUSTOMOBJECT where ACCOUNTIDLOOKUPFIELD=:currentAccount.Id];

            }

            return esProjList;

        }

        

        private set;

        }

        

        public ESCompanyRelatedProjectsCnt(ApexPages.StandardController stdController) {

            currentAccount = (Account)stdController.getRecord();

        }

        

    }// END - Controller

    Regards,

    Pawan Kumar

     
Loading
0/9000