What are the best practices for using the `display` field in the data model?

What are some useful practices for defining the <display> </display> tags in my data model?

Specifically:

Should certain parts be text and others format strings?

What are good delimiters for displaying multiple field and relationship data in this tag?

Where is the data I enter here exposed to the developer?

Where is the data I enter here exposed to the end user?

Should certain parts be text and others format strings?

It does not have to be, but it could be. You could use either of these examples:

<display>{load_no} - {shipment_date}</display>

or

<display>#{load_no} - date: {shipment_date}</display>

What are good delimiters for displaying multiple fields and relationship data in this tag?

This depends on your personal preference and what you are trying to achieve, here is a good example of one that uses : and -:

<display>{date} - (300ml) EA : {drinkage_bottle_total} (Tab) EA : {drinkage_litre_total} </display>

Where is the data I enter here exposed to the developer?

See my answer below

Where is the data I enter here exposed to the end-user?

There are three areas where the display values are exposed:

  1. Back-end data browser: The display names are used to populate the display values for each row of a selected object as well as the display name for belongs-to relationships.
  2. Editor: The developer can access the display value of an object using the .toString() method.
  3. App: By default, the display name is used in view components if the object is referenced directly. Examples include the object-dropdown and object-table component.
3 Likes

Can I use XML Functions to format the data as well?