https://wiki.mementodatabase.com/index.php?title=Spec:Field_Link_to_Entry&feed=atom&action=historySpec:Field Link to Entry - Revision history2024-03-29T09:23:10ZRevision history for this page on the wikiMediaWiki 1.39.2https://wiki.mementodatabase.com/index.php?title=Spec:Field_Link_to_Entry&diff=4221&oldid=prevUnConnoisseur at 20:33, 1 March 20222022-03-01T20:33:15Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="@@locale@@">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 13:33, 1 March 2022</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l5">Line 5:</td>
<td colspan="2" class="diff-lineno">Line 5:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A Link To Entry field may contain a link to an entry or to entries in another library.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A Link To Entry field may contain a link to an entry or to entries in another library.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=== Database principles & terminology ===</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; 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.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; 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.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; 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.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; 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.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">In addition </del>to <del style="font-weight: bold; text-decoration: none;">creating </del>a Link <del style="font-weight: bold; text-decoration: none;">To </del>Entry field in the <del style="font-weight: bold; text-decoration: none;">normal fashion, </del>one may <del style="font-weight: bold; text-decoration: none;">also insert a Relationship</del>, which <del style="font-weight: bold; text-decoration: none;">accomplishes </del>the <del style="font-weight: bold; text-decoration: none;">same thing</del>, <del style="font-weight: bold; text-decoration: none;">using the name </del>of <del style="font-weight: bold; text-decoration: none;">the linked </del>library as <del style="font-weight: bold; text-decoration: none;">the link field name</del>. This <del style="font-weight: bold; text-decoration: none;">method may be </del>more <del style="font-weight: bold; text-decoration: none;">intuitive for some users</del>.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">How </ins>to <ins style="font-weight: bold; text-decoration: none;">define </ins>a Link <ins style="font-weight: bold; text-decoration: none;">to </ins>Entry field <ins style="font-weight: bold; text-decoration: none;">can be confusing </ins>in <ins style="font-weight: bold; text-decoration: none;">various ways. One is called ''cardinality'' of </ins>the <ins style="font-weight: bold; text-decoration: none;">relationship between </ins>one <ins style="font-weight: bold; text-decoration: none;">library and the other. Below are 3 explanations that </ins>may <ins style="font-weight: bold; text-decoration: none;">be helpful to you -- first my summary, using Memento's language</ins>, which <ins style="font-weight: bold; text-decoration: none;">deviates from </ins>the <ins style="font-weight: bold; text-decoration: none;">norm. Then 2 articles that appear to me to be thoughtful and authoritative. Keep in mind that in those articles</ins>, <ins style="font-weight: bold; text-decoration: none;">what you may think </ins>of <ins style="font-weight: bold; text-decoration: none;">as a </ins>library <ins style="font-weight: bold; text-decoration: none;">will be called a table, and what you may think of </ins>as <ins style="font-weight: bold; text-decoration: none;">an entry will be called a record or possibly a row.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">We'll start with my summary, using Memento language. Here it is:</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">: [[About:DatabaseRelationshipsCardinality|About ''many-to-many, one-to-many, & one-to-one'' library relationships or links]]</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">: This article from a database theory blog is not too long, says it succinctly.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">: https://vertabelo</ins>.<ins style="font-weight: bold; text-decoration: none;">com/blog/cardinality-in-data-modeling/</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">: </ins>This <ins style="font-weight: bold; text-decoration: none;">article from DePaul University gives a </ins>more <ins style="font-weight: bold; text-decoration: none;">detailed look at the subject.</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">: https://condor.depaul.edu/gandrus/240IT/accesspages/relationships</ins>.<ins style="font-weight: bold; text-decoration: none;">htm</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>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.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>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.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l25">Line 25:</td>
<td colspan="2" class="diff-lineno">Line 35:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{FieldNameHint}}</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{FieldNameHint}}</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>== Advanced Parameters ==</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=</ins>== Advanced Parameters <ins style="font-weight: bold; text-decoration: none;">=</ins>==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; Library : Select from the list the library to which you wish to link</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; Library : Select from the list the library to which you wish to link</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l46">Line 46:</td>
<td colspan="2" class="diff-lineno">Line 56:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{FieldDepend}}</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{FieldDepend}}</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>== Examples ==</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=</ins>== Examples <ins style="font-weight: bold; text-decoration: none;">=</ins>==</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For each of these scenarios, there are many templates in the online template catalog &mdash; perhaps to use with little or no customization &mdash; or perhaps to study and learn their techniques before implementing your own.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>For each of these scenarios, there are many templates in the online template catalog &mdash; perhaps to use with little or no customization &mdash; or perhaps to study and learn their techniques before implementing your own.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>=== Tracking spending on groceries ===</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=</ins>=== Tracking spending on groceries <ins style="font-weight: bold; text-decoration: none;">=</ins>===</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In this scenario, we shop at grocery stores at certain dates/times (receipts) and buy grocery items.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In this scenario, we shop at grocery stores at certain dates/times (receipts) and buy grocery items.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l62">Line 62:</td>
<td colspan="2" class="diff-lineno">Line 72:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Slice & dice within the Grocery Purchases library.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Slice & dice within the Grocery Purchases library.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>=== Commercial product sales ===</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=</ins>=== Commercial product sales <ins style="font-weight: bold; text-decoration: none;">=</ins>===</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In this scenario, one or more companies each has its own products and customers.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In this scenario, one or more companies each has its own products and customers.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l108">Line 108:</td>
<td colspan="2" class="diff-lineno">Line 118:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Slice & dice mostly within the Classes library, referencing Students.Name, Instructors.Name, Courses.Subject, etc.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Slice & dice mostly within the Classes library, referencing Students.Name, Instructors.Name, Courses.Subject, etc.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>=== Doctors, drugs, and pharmacies ===</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=</ins>=== Doctors, drugs, and pharmacies <ins style="font-weight: bold; text-decoration: none;">=</ins>===</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In this scenario, one or more doctors are affiliated with one or more hospitals, both provide services to patients, doctors prescribe drugs, patients take drug doses, etc.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>In this scenario, one or more doctors are affiliated with one or more hospitals, both provide services to patients, doctors prescribe drugs, patients take drug doses, etc.</div></td></tr>
</table>UnConnoisseurhttps://wiki.mementodatabase.com/index.php?title=Spec:Field_Link_to_Entry&diff=4219&oldid=prevUnConnoisseur: Created page with "{{Stamp|2022-02-27|4.10.4|1.10.1}} {{BannerMenu}} {{PageTitle|Link to Entry field}} A Link To Entry field may contain a link to an entry or to entries in another library. ;..."2022-02-27T13:57:04Z<p>Created page with "{{Stamp|2022-02-27|4.10.4|1.10.1}} {{BannerMenu}} {{PageTitle|Link to Entry field}} A Link To Entry field may contain a link to an entry or to entries in another library. ;..."</p>
<p><b>New page</b></p><div>{{Stamp|2022-02-27|4.10.4|1.10.1}}<br />
{{BannerMenu}}<br />
{{PageTitle|Link to Entry field}}<br />
<br />
A Link To Entry field may contain a link to an entry or to entries in another library.<br />
<br />
; 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.<br />
<br />
; 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.<br />
<br />
; 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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
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")'''''.<br />
<br />
; Accessing attributes of Link to Entry fields<br />
: Link to Entry fields may have attributes that will have a value for each linked entry. See '''[[Attributes of linked entries]]'''.<br />
<br />
; Importing linked Google Sheets<br />
: Links can be set during import or sync with Google Sheets. The Entry Name field or fields (concatenated) is used as the key. "The entry name is unique" option must be enabled in the associated library.<br />
<br />
{{FieldNameHint}}<br />
<br />
== Advanced Parameters ==<br />
<br />
; Library : Select from the list the library to which you wish to link<br />
<br />
; Display aggregation : Display aggregation by entries of the linked library? Yes or no<br />
<br />
; Type of relationship : Choices are:<br />
:* Many-to-many<br />
:* One-to-many<br />
:* One-to-one<br/><br/>By default, it will be a many-to-many relationship.<br />
<br />
{{FieldRequired}}<br />
<br />
== Display Options ==<br />
<br />
{{FieldRoleRNDS}}<br />
<br />
{{FieldOnCard}}<br />
<br />
{{FieldDepend}}<br />
<br />
== Examples ==<br />
<br />
For each of these scenarios, there are many templates in the online template catalog &mdash; perhaps to use with little or no customization &mdash; or perhaps to study and learn their techniques before implementing your own.<br />
<br />
=== Tracking spending on groceries ===<br />
<br />
In this scenario, we shop at grocery stores at certain dates/times (receipts) and buy grocery items.<br />
<br />
; We visit stores to shop for groceries.<br />
: Create a one-to-many Link To Entry field within library Grocery Receipts to library Stores. Grocery Receipts contains fields for date/time, payment method, etc. Stores contains contact information, location, etc.<br />
<br />
; We buy grocery items during visits; the items appear on receipts.<br />
: Create a one-to-many Link To Entry field within library Grocery Purchases to library Grocery Receipts. Grocery Purchases contains fields for the brand, variety, item, units, quantity, category, etc.<br />
<br />
Slice & dice within the Grocery Purchases library.<br />
<br />
=== Commercial product sales ===<br />
<br />
In this scenario, one or more companies each has its own products and customers.<br />
When an order is taken, multiple of the company's products may be sold, each of which will be a line item on the order.<br />
<br />
; Companies have products.<br />
: Create a one-to-many Link To Entry field within library Products to library Companys. To allow companies to share products, make it a many-to-many relationship.<br />
<br />
; Companies have customers.<br />
: Create a one-to-many Link To Entry field within library Customers to library Companys. To allow companies to share customers, make it a many-to-many relationship.<br />
<br />
; Customers place orders.<br />
: Create a one-to-many Link To Entry field within library Products to library Customers. It doesn't make sense for multiple customers to collaborate in placing an order.<br />
<br />
; Each order is for one or more items, each for a quantity of a product.<br />
: Create a one-to-many Link To Entry field within library Order Line Items to library Orders. An line item belongs to exactly one order.<br />
<br />
; Products are sold via orders as line items.<br />
: Create a one-to-many Link To Entry field within library Order Line Items to library Products. Each line item is for a product.<br />
<br />
Slice & dice mostly within the Order Line Items library, referencing Products.Price and Orders.Date.<br />
<br />
=== Students taking classes ===<br />
<br />
In this scenario, one or more academic departments employ(s) instructors, offer(s) courses, admit(s) students, schedule(s) classes taught by instructors and attended by students ===<br />
<br />
; Instructors work for one or more academic departments.<br />
: Create a many-to-many Link To Entry field within library Instructors to library Departments.<br />
<br />
; Courses are offered by an academic department.<br />
: Create a one-to-many Link To Entry field within library Courses to library Departments. To support interdisciplinary courses, make that a many-to-many relationship.<br />
<br />
; Students enroll to be eligible for classes.<br />
: Create a one-to-many Link To Entry field within library Students to library Departments. Let's say they pick a major in some department.<br />
<br />
; Instructors are assigned to teach classes.<br />
: Create a one-to-many Link To Entry field within library Classes to library Instructors.<br />
<br />
; Classes are offered for particular courses.<br />
: Create a one-to-many Link To Entry field within library Classes to library Courses.<br />
<br />
; Enrolled students register for certain classes.<br />
: Create a many-to-many Link To Entry field within library Students to library Classes.<br />
<br />
Slice & dice mostly within the Classes library, referencing Students.Name, Instructors.Name, Courses.Subject, etc.<br />
<br />
=== Doctors, drugs, and pharmacies ===<br />
<br />
In this scenario, one or more doctors are affiliated with one or more hospitals, both provide services to patients, doctors prescribe drugs, patients take drug doses, etc.<br />
<br />
; Doctors provide services to patients.<br />
: Create a many-to-many Link To Entry field within library Services to library Doctors.<br />
<br />
; Doctors write prescriptions for drugs to patients<br />
: Create a one-to-many Link To Entry field within library Prescriptions to library Doctors.<br />
<br />
; Pharmacies fill and refill prescriptions<br />
: Create a one-to-many Link To Entry field shotgun library Pavilions to library Pharmacies.<br />
<br />
; Patients take drug doses<br />
: Create a one-to-many Link To Entry field within library Doses tip library Prescriptions.<br />
<br />
Slice & dice within Doses to manage prescriptions, referencing Doctors.Name, Drug.Name, Prescriptions.Quantity, Prescriptions.Refills, etc.<br />
<br />
[[Category:en]] [[Category:Spec]] [[Category:FieldType]]</div>UnConnoisseur