How can I fetch the value of staff lookup field of incident object in an apex class? In an incident object, staff lookup field has a value as 'xyz'. How can I get this field in an apex class?

  • 3
    Please provide more details, what have you tried and where you're stuck – Rohit Mourya May 30 '17 at 12:36

Output Field will output the value of the lookup field but it will display a link to the object that the field references in the lookup relationship. If you want to show a more specific value on the referenced object you can use relationship chaining from the standard or custom controller Object that your VF page uses to the value on the related object like so: {!Incident__c.Staff__r.staff_name__c}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.