Link To Entry field: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Stamp|2016-011-22|4.1.0|1.0.7}}
{{Stamp|2020-12-08|4.9.2|1.8.1}}
A Link To Entry field may contain a link to an entry or to entries in another library.
A Link To Entry field may contain a link to an entry or to entries in another library.


; For many-to-many links: When an entry is created or edited, the user may select the entries in the linked library to which the new entry will be linked.<br/>Though a many-to-many relationship is theoretically symmetrical, the link field is created in only one of the libraries, so choose the library that you intend to use to reference the other.
; For many-to-many links: When an entry is created or edited, the user may select the entries in the linked library to which the new or edited entry will be linked.<br/>Though a many-to-many relationship is theoretically symmetrical, the link field is created in only one of the libraries, so choose the library that you intend to use to reference the other.


; For one-to-many links: When an entry is created or edited, the user may select the entry in the linked library to which the new entry will be linked.<br/>The link is created in the library that will contain the children (the '''many''' side), identifying at library edit time the library that will contain the parent entry (the '''one''' side) and identifying at entry creation or edit time the entry in that library that is the parent of the entry being created or edited.
; For one-to-many links: When an entry is created or edited, the user may select the entry in the linked library to which the new or edited entry will be linked.<br/>The link is created in the library that will contain the children (the '''many''' side), identifying at library edit time the library that will contain the parent entry (the '''one''' side) and identifying at entry creation or edit time the entry in that library that is the parent of the entry being created or edited.


; For one-to-one links: When an entry is created or edited, the user may select the entry in the linked library to which the new entry will be linked. If the selected entry is already linked to another entry in the current library, the attempt will be disallowed.<br/>Though a one-to-one relationship is theoretically symmetrical, the link field is created in only one of the libraries, so choose the library that you intend to use to reference the other.
; For one-to-one links: When an entry is created or edited, the user may select the entry in the linked library to which the new or edited entry will be linked. If the selected entry is already linked to another entry in the current library, the attempt will be disallowed.<br/>Though a one-to-one relationship is theoretically symmetrical, the link field is created in only one of the libraries, so choose the library that you intend to use to reference the other.


In addition to creating a Link To Entry field in the normal fashion, one may also insert a Relationship, which accomplishes the same thing, using the name of the linked library as the link field name. This method may be more intuitive for some users.
In addition to creating a Link To Entry field in the normal fashion, one may also insert a Relationship, which accomplishes the same thing, using the name of the linked library as the link field name. This method may be more intuitive for some users.


When an entry is created, the user will be prompted to establish the value of the field, which involves accessing the target library and displaying an Entries List, enabling selection of target entr(y|ies). The user also may deselect target entr(y|ies) when the entry is edited.
When an entry is created, the user will be prompted to establish the value of the field, which involves accessing the target library and displaying an Entries List, enabling selection of target entr(y|ies). The user also may select and/or deselect target entr(y|ies) when the entry is edited.


Once linked, fields in the linked library may be referenced from the current library from '''[[Calculation field]]''' scripts, '''[[JavaScript field]]''' scripts, and from aggregation functions.<br/>From a  Calculation field, use linkFieldName.fieldName or pick from +Field list. From a JavaScript field, use field("linkFieldName")["fieldName"]. (If from a trigger script, you would need entry().field("linkFieldName")["fieldName"].)
Once linked, fields in the linked library may be referenced from the current library from '''[[Calculation field]]''' scripts, '''[[JavaScript field]]''' scripts, and from aggregation functions.<br/>From a  Calculation field, use '''''linkFieldName.fieldName''''' or pick from the '''+Field''' list. From a JavaScript field, use '''''field("linkFieldName")[0].field("fieldName")'''''. If from a trigger script, you would need '''''entry().field("linkFieldName")[0].field("fieldName")'''''.
 
; Accessing attributes of Link to Entry fields
: Link to Entry fields may have attributes that will have a value for each linked entry. See '''[[Attributes of linked entries]]'''.


; Importing linked Google Sheets
; Importing linked Google Sheets
Line 120: Line 123:
Slice & dice within Doses to manage prescriptions, referencing Doctors.Name, Drug.Name, Prescriptions.Quantity, Prescriptions.Refills, etc.
Slice & dice within Doses to manage prescriptions, referencing Doctors.Name, Drug.Name, Prescriptions.Quantity, Prescriptions.Refills, etc.


[[Spec:Field Link to Entry]]
[[Category:Spec]]
[[Category:Spec]]

Navigation menu