You need to sign in to do that
Don't have an account?
Asaf14
Visualforce - get a field inside lookup
hello,
I am new in salesforce, so I hope i will explain well.
I have a list inside my class:
AttLst = new List<Attendance__c>([SELECT id,Name,Exam__c, FROM Attendance__c]);
The Exam__c is a lookup object, Inside the Exam Object i have Name and Datetime__c field.
I want to get in visualforce the Datetime field.
<apex:pageBlockTable value="{!AttLst }" var="at">
<apex:column value="{!at.Name}" />
<apex:column value="{!at.Exam__c}" /> // here i get the name of the exam
<apex:column value="{!at.Exam__c.Datetime__c}" /> // Here i get an error.
</apex:pageBlockTable>
How can i do it? maybe changing the SOQL or maybe I didn't syntax error...
Please help me understand. Thank you.
I am new in salesforce, so I hope i will explain well.
I have a list inside my class:
AttLst = new List<Attendance__c>([SELECT id,Name,Exam__c, FROM Attendance__c]);
The Exam__c is a lookup object, Inside the Exam Object i have Name and Datetime__c field.
I want to get in visualforce the Datetime field.
<apex:pageBlockTable value="{!AttLst }" var="at">
<apex:column value="{!at.Name}" />
<apex:column value="{!at.Exam__c}" /> // here i get the name of the exam
<apex:column value="{!at.Exam__c.Datetime__c}" /> // Here i get an error.
</apex:pageBlockTable>
How can i do it? maybe changing the SOQL or maybe I didn't syntax error...
Please help me understand. Thank you.
You need to query for those related object fields. Update the SOQL query like this
In Visualforce page, you can get the datetime value as shown below:
Thanks,
Naga