I have a table that with an Instance Name of clientName, and using the entitypicker on an edit screen works correctly. However, sometimes that isn’t the data I’d like to display, and instead would like to display clientAddress. Is is possible to get another field instead of the one referenced by the Instance Name?
I have tried with the below, however that causes both clientName and clientAddress fields to show in the same column in my grouptable.
@InstanceName
@DependsOnProperties({"clientName", "clientAddress"})
public String getInstanceName() {
return String.format("%s %s", clientName, clientAddress);
}
Solved it with the following:
Modified the instanceName getter to the following:
@DependsOnProperties({"clientName", "clientAddress"})
public String getInstanceName() {
return String.format("%s_%s", clientName, clientAddress);
}
Then used generated columns to split the data to what I needed and display it.
Perhaps you could do it simpler.
Consider the Department
entity having a reference to User
entity through hrManager
field. Let’s show username
attribute instead of the User’s instance name in the table and in the entity picker.
-
In a table, just set the path to the attribute:
<columns> <column id="name"/> <column id="hrManager.username"/> </columns>
-
In a picker, set
captionProperty
attribute:<entityPicker id="hrManagerField" property="hrManager" captionProperty="username">
1 Like