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
satakshisatakshi 

Records are not displayed

Hello,

I am creating a visualforce page. Where i want to show records. Here MTP is parent object and DTP is child object. I have created code where i am inserting records. I want to show those inserted records on visualforce pages.I have written the code. But records are not displaying.Can anyone please help me with this? 

Controller:
public class showCalender {
    public List<DTP__c> mydtpList {set;get;}
     public  id tid{get;set;}


    public showCalender(ApexPages.StandardController controller)
     {
          tid = ApexPages.currentPage().getParameters().get('id');
         System.debug('***************dtp added*******************'+tid); 
        getMydtpList();
     }
       public List<DTP__c> getMydtpList(){
      
    
        List<DTP__c> mydtpList =[select Name, Expenses__c, MTP__c, Food_Expenses__c, Date__c, Visit_type__c from DTP__c where MTP__c=:tid limit 50];

        return mydtpList ;
        }
    //List<DTP__c>  mydtpList = [select Expenses__c, Name, MTP__c, Food_Expenses__c, Visit_type__c from DTP__c where id=:tid];

    }


Visualforce Page:
<apex:page standardController="MTP__c"  extensions="showCalender">
<apex:form >
 <apex:pageBlock title="All Dtp">
 <apex:pageblockTable value="{!mydtpList}" var="item">
 <apex:column value="{!item.Name}"/> 
 <apex:column value="{!item.Date__c}"/> 
 <apex:column value="{!item.Visit_type__c}"/> 
 <apex:column value="{!item.Food_Expenses__c}"/> 
</apex:pageblockTable>
 </apex:pageBlock> 
 </apex:form>
</apex:page>
Harish RamachandruniHarish Ramachandruni
Hi ,

youhave to pass id in url like :



https://c.na9.visual.force.com/apex/pages/AccountRecord?id=a00E0000002RzBR


Regards ,
Harish.R.




 
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Are you setting the "id" parameter in the url?
satakshisatakshi
https://nulife--c.na35.visual.force.com/apex/ShowDTP?id=a0041000001lrDV
Is this right? nothings changes