You need to sign in to do that
Don't have an account?
Stephen Chin 5
Display value from related lookup record in Visualforce page
I created a custom object called Usage that has a lookup relationship to the standard Account object. I am trying to create a Visualforce page that will display all of the fields from a Usage record directly on the Account page if the two are linked via the lookup field.
I am new to VF, and I created a VF page with the following code:
I looked into SObjects but am unclear what the issue is.
I am new to VF, and I created a VF page with the following code:
<apex:page standardController="Account"> <apex:pageBlock title="Usage"> <apex:pageBlockSection> <apex:outputField value="{! Account.Usage__c.Name }"/> <apex:outputField value="{! Account.Usage__c.Last_User_Login_Date__c }"/> <apex:outputField value="{! Account.Usage__c.Request_Manager_Enabled__c }"/> <apex:outputField value="{! Account.Usage__c.Users__c }"/> </apex:pageBlockSection> </apex:pageBlock> </apex:page>However, I get the following error when trying to save: Could not resolve the entity from value binding '{Account.Usage__c.Name}' can only be used with SObjects, or objects that are Visualforce field component resolvable.
I looked into SObjects but am unclear what the issue is.
Greetings!
If you would like to display the related Objects data on the parent Object then you should call the child Object as Usage__r(customObjects).If it is standard Objet then this should be Usages.
So,please try by changing the extension from __c to __r and let me know,if it fix the issue.
Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Here is an example
Just try this and let me know if you need further assistance