35.5k views
0 votes
Object x has a lookup field to Object Y. X needs to display a text field on Y. To ensure data integrity, how would a developer implement this?

1) Create a cross-object formula field on Object x that retrieves the value from Y.
2) Create a text field on Object X and use Apex to populate the value.
3) Create a rollup summary field on Object X that retrieves the value from Y.
4) Create a text field on Object x and use a workflow rule to fill in the value upon the creation of X.

1 Answer

4 votes

Final answer:

To ensure data integrity when displaying a text field from Object Y on Object X, a cross-object formula field should be created on Object X.

Step-by-step explanation:

If Object X has a lookup field to Object Y and X needs to display a text field from Y to ensure data integrity, the developer should create a cross-object formula field on Object X that retrieves the value from Y. This approach does not require any coding and maintains real-time accuracy of data by automatically displaying the current value of the text field from Object Y on Object X. Rollup summary fields are used to perform calculations on child records and hence are not applicable in this context. Using Apex or a workflow rule to copy the text field's value from Object Y to a text field on Object X requires additional configuration and can lead to data integrity issues if not properly maintained.

User Alexander Fadeev
by
7.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.