function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sameer PremjiSameer Premji 

How to display the value of a Lookup field from the parent onto the child object?

Hello,

I have a CASE standard object (Parent) on which there is a custom lookup field "Pick-up Location" whereby, a user clicks on a magnifying glass icon and selects a value.

I have a SHIPMENT custom object (Child to the CASE) on which I have created a new custom formula field "Pick-up Location" of return type Text. I want to display the value from the parent's "Pick-up Location" lookup field but cannot seem to figure out the correct formula.

I tried in the formula editor Pick-up Location = parent_object.field_name but it doesn't display the value, instead, it displays the ID (a2Bo0000000PXIw) as plain Text.

I tried TEXT(parent_object.field_name) but it throws an error since it is not a Picklist field but a Lookup field whose value we need.

I'd appreciate the response to be within the Declarative Click configuration instead of APEX code.

Thanks!
Ravikant Saini 1Ravikant Saini 1
you can use apex:inputfield for it and the parent_object variable in controller will be public with get; set; access.
<apex:inputfield value="{!parent_object.field_name}"/>

Mani RenusMani Renus
Create Formula field on SHIPMENT object of text ,in formula eidtor try below one

Case.Pick-up Location__c.name
Sameer PremjiSameer Premji
@Mani: Case.Pick-up Location__c.name did not work!

@Ravikant: I don't know how to insert that code.