You need to sign in to do that
Don't have an account?

Call a custom controller method from a VF page and display the data
I am doing a soql on a custom object which is a lookup to a standard object(case). This works I changed the ending with an r Quote_Request__r. I dont know how to display Quote_Request__r..name.
--------------------------class--------------
public class operations_class{
public List<Case> getNewCases(){
List<Case> filterList = [SELECT AccountId,CreatedById,Quote_Request__r.name FROM case WHERE Id ='50005000005ym2OAAQ' ];
return filterList;
}
}
-----------------------------VFpage-----------------------------
<apex:page controller="operations_class">
<apex:pageBlock>
<apex:pageBlockTable value="{!filterList}" var="a">
<apex:column value="{!a.Quote_Request__r.name}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
--------------------------class--------------
public class operations_class{
public List<Case> getNewCases(){
List<Case> filterList = [SELECT AccountId,CreatedById,Quote_Request__r.name FROM case WHERE Id ='50005000005ym2OAAQ' ];
return filterList;
}
}
-----------------------------VFpage-----------------------------
<apex:page controller="operations_class">
<apex:pageBlock>
<apex:pageBlockTable value="{!filterList}" var="a">
<apex:column value="{!a.Quote_Request__r.name}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Refer the below link and modify your code.
https://salesforce.stackexchange.com/questions/295767/retrieve-account-related-contacts
If this helps, Please mark it as best anwer.
Thanks!!