A mirror property is a property that is created in a target object but get’s its value from a property of another source object.
Both properties (source & object) exist separately but the value of the source is copied into the mirror property of the target object.
The mirror property is not read-only. The user has full control of it’s contents, enabling them to overwrite the copied value (from source) with any arbitrary value.
For Mirror Property to work, a relation must exist between the relevant two entities.
Only One-to-Many relation supports the Mirror property.
The source property is created at the “One” side of the relation and mirrored at the “Many” side of the relation. For example, in the given scenario, the original property would be created in Employee and mirrored in Attendance.
Once Mirror Property is created in the App model, whenever a new record is created, the corresponding fields are automatically filled up using the relevant fields from the source records.
While adding the record, if the source record is changed, then the values of the mirrored properties also get updated at runtime.
Any type of property can be mirrored except the HTML type.
Adding a Mirror Property
On the App Model page, select the object where the mirror property is to be created.
Note: Make sure that a 1:M relation exist between the selected object and the source object whose property would be mirrored.
Click the New Property button.
Click on Type dropdown control and select the Mirror option.
Choose the Source Object (the one from which the property will be mirrored). Since the target object has a one-to-many relationship with only one other object, only that single related object is shown in the dropdown.
Select the relation.
Select the source property.
Give a proper name to the mirror property and then click the Create button.
The Mirror Property is added.
Click the Update App button.
Confirm by clicking the Confirm button.
Now in the object with the mirror property; when a new record is being created or existing is updated, both the reference and mirror properties are being shown.
As soon as the reference property is selected…
The value of the mirror property is updated as per the value in the source property.
A mirror property is a property that is created in a source object but also used in another object to get its values of records.
Difference between Reference Property and the Mirror Property
The difference between Reference Property and Mirror Property is that the Reference Property is primarily used to link two objects (creating relation between them), while the Mirror Property is used to get the values of records from source object and use it in the destination object.
The ReferenceProperty can only be of text type, while the MirrorProperty can be of any type except the HTML type.