You need to sign in to do that
Don't have an account?
Isak Stensmar 8
Access Lookup value on Visualforce page
Hi,
I have a lookup relationship on a custom object which relate to itself, so it is possible that 1stObj links to 2ndObj, 2ndObj links to 3rdObj and so on.
I´m trying to access the value from the lookup field but I don´t know how to proceed and I´m not really sure how relationships works (even though I´ve read guides and other peoples solutions).
My code basically look like this where I try to access the value from the lookup field.
Link_Objects is my Lookup field which relate to MonthlyDonor.
Link_Objects contains a MonthlyDonor ID from another MonthlyDonor.
I´ve tried using only the monhtlydonorid or __c but that does not work.
I´ve also tried to create an extension to the standardController but without any luck.
Any solutions or adivce would be greatly appriciated.
/Isak
I have a lookup relationship on a custom object which relate to itself, so it is possible that 1stObj links to 2ndObj, 2ndObj links to 3rdObj and so on.
I´m trying to access the value from the lookup field but I don´t know how to proceed and I´m not really sure how relationships works (even though I´ve read guides and other peoples solutions).
My code basically look like this where I try to access the value from the lookup field.
<apex:page standardController="MonthlyDonor__c"> <apex:outputLink value="{!MonthlyDonor__c.Link_Objects__r.Id" title="Linked Object"> Linked Object </apex:outputLink>MonthlyDonor is my custom Object.
Link_Objects is my Lookup field which relate to MonthlyDonor.
Link_Objects contains a MonthlyDonor ID from another MonthlyDonor.
I´ve tried using only the monhtlydonorid or __c but that does not work.
I´ve also tried to create an extension to the standardController but without any luck.
Any solutions or adivce would be greatly appriciated.
/Isak
First it is possible to have self lookup on a object. Even native object account has a parent account.
What do you want to show on VFP, do you want to show Hierarchy ?
Thanks
Shashikant