You need to sign in to do that
Don't have an account?
satakshi
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>
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>
youhave to pass id in url like :
https://c.na9.visual.force.com/apex/pages/AccountRecord?id=a00E0000002RzBR
Regards ,
Harish.R.
Is this right? nothings changes