The Reference field is used to refer to values of fields in other documents within the same document system.
The differences between a Reference Field and an Autocomplete field:
- The AutoComplete field persists the label of the referenced document. This in opposition to the reference field type that stores the referenceId to the document. In other words; there isn't a link between the Autocomplete field and the referenced document.
- The AutoComplete field allows free textual input.
For example: There is an Order document that holds information on the number of purchased items per company. Because companies are also used in other processes, it has it's own Document Definition and therefore each company is a document itself. With the help of a Reference Field, the Order document can make use of the information stored in a Company Document. When information changes within the Company Document, this information also changes in the Order Document.
|Label||Yes||The label is used for users of BizzStream. The label is shown in documents left to the value of the field. Labels can always be edited.|
|Translation key||No||Can be used to replace the field label with a translation. If set, BizzStream will try find the translation associated with the key set in this field. If no translation can be found, the label set in the Label field will be used.|
|Name||Yes||The name is a BizzStream system field. Once the Document Definition is persisted, this field cannot be edited anymore. Unless there are no documents based on this document definition.|
|Required||No||By checking the required-option, you force the user to fill out the field. By not checking this option, the option to fill out the field is to the discretion of the user.|
|Reference type||Yes||This field dictates whether there are references to one or more documents. If you refer to only one document you have to choose the one-on-one (1-1) option. If you refer to more documents please choose the one-to-more (1-N) option.|
|Related Document||Yes||Choose the Document Definition you want to refer to.|
|Reference Label||Yes||The reference Label dictates how a label is set up. You can specify the field from the Document Definition you are referring to. You can use a BizzStream Expressions to set this up. For example you can use
|Filter||No||It is possible that the document to which you refer has to meet certain criteria for its characteristics. You can force this by using a filter. This field can contain BizzStream Expressions. For example you can use
|Search Method||Yes||The 'Search Method' refers to how you search for the reference field. The options are contains, begins with and ends with|
|Sort Field||No||Select the field that is used to sort the suggestions. By default the suggestions don't get sorted.|
|Sort Order||No||Select here whether you want to sort the suggestions ascending or descending.|
|Validate Reference Field||No||Because sometimes it's unnecessary to validate all reference fields in a document when the document is saved, you have the option to validate only the fields that actually have been updated.|
|When a Related Document is deleted||Yes||When a Related Document is deleted you have three options
1. Prevent Deleting: the referred document cannot be deleted.
2. Delete this Document: the document that contains the reference will be completely deleted.
3. Delete Reference: the reference to this document will also be deleted.
|Initial Value||No||By providing an initial value to the field, upon creation the field or linefield will have this value. This field cannot refer to values placed in other fields. A user/visitor can overwrite this value.|
|Initial Placeholder||No||When you provide an initial placeholder, the field will get the value of the field to which the placeholder refers. Users/visitors can update this value. Unlike placeholders, the field will not updated when the field to which the placeholder refers updates. This field can contain BizzStream Expressions referring to other fields.|
|Placeholder||No||By providing a placeholder, you ensure that the value of this field is replaced by the value of the field to which the placeholder refers when the referenced field updates.|
How the data is stored
Reference fields will be saved accordingly in the database:
A one-to-one (1-1) reference is saved in the database by using the BizzStream ID of the referred document:
A one-to-many (1-N) reference is saved in the database by using the collection of BizzStream IDs of the referred document:
QR codes in mobile reference and autocomplete
In some cases, reference fields may point to documents that have reference labels that are very similar (say a 10 digit identification code). If users enter this code manually, there is a high risk of typing errors. This can be reduced by completing reference fields by scanning a QR code.