A code component on the case form displays a small summary of the case's primary contact, and its labels must match the display names of the contact table's columns in the user's language, including any renamed columns. How should the component obtain the labels?
Select an answer to reveal the explanation.
Short Explanation
Labels can be renamed by makers anytime, so don't bake them into your code. getEntityMetadata asks the platform for the contact table's current display names in your user's language, and you just read them off.
Full Explanation
The component framework's Utility API includes getEntityMetadata, which takes a table logical name and an optional list of column names and returns a promise resolving to metadata for that table and those columns. The result includes each column's display name in the user's language, along with information such as required level and option set values, so the component can label its output exactly as the platform does, including columns that makers have renamed. Hard-coded RESX labels can localize a component's own static strings, which is useful, but they cannot follow renamed columns or customizations made in each environment, and the premise that metadata is unavailable is false. A bound property's formatted value describes the value of the column the component is bound to, not the display names of another table's columns. Calling the metadata endpoint with a token copied into settings is insecure and brittle: tokens expire, and placing credentials in component configuration exposes them to anyone who can read the form definition. Exam caveat: metadata calls are asynchronous, so the component should request metadata once, cache the result in memory and render after the promise resolves, rather than fetching on every updateView. Operational check: rename a contact column's display name, switch the user's language, and confirm the component's labels follow both changes.