创建 Filemaker 布局以将 0 到 n 条记录添加到另一个表中的记录。
我有 3 个表格(为了清楚起见,我只列出了一些字段):
表 1(ID、描述 1)
表 2 > (ID, 描述2)
表 3 (ID, Table1ID, >Table2ID)
基本上我正在使用表 3 创建多对多联接(并通过关系选项卡链接各个 ID,并将 ID 字段设置为自动创建)。我希望能够创建一个包含表 1 中所有记录的布局,并允许用户在下拉列表中从表 2 中选择 0 到 n 个项目。
到目前为止,我有一个包含 表 1 描述 1 字段的布局,并尝试将门户与 中的 描述 2 字段一起放置表 2。然后,我通过检查器和 Values from: 属性中的 Table 2 将控件样式更改为下拉菜单。
我不确定这是否可能或正确的方法。我希望 Filemaker 能够使用关系图并创建必要的记录(实质上是表 3 中的条目将两者链接在一起),但我收到以下错误:“此操作无法因为一个或多个所需的相关记录不可用且无法创建。”
任何帮助将不胜感激,请对 Filemaker 新手放轻松 :o)
I have 3 tables (for clarity am only listing some fields):
Table 1 (ID, Description1)
Table 2 (ID, Description2)
Table 3 (ID, Table1ID, Table2ID)
Essentially I am using Table 3 to create a many-to-many join (and have linked the various IDs through the relationships tab and set the ID fields to be autocreated). I want to be able to create a layout with all records from Table 1 and allow a user to select 0 to n items from Table 2 in a dropdown.
So far I have a layout that contains the Table 1 Description 1 field and have tried putting a portal with the Description 2 field from Table 2. I then changed the control style to dropdown through the inspector and Table 2 in the Values from: property.
I am not sure if this is even possible or the correct approach. I was hoping Filemaker would use the relationship graph and create the necessary records (essentially entries in Table 3 linking the two together), but I receive the following error: "This operation cannot be performed because one or more required related records are not available and cannot be created."
Any help would be appreciated and please go easy on the Filemaker newbie :o)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这几乎是正确的;您需要有一个表 3 的入口,允许通过此关系创建记录,将 Table3::Table2ID 放在那里,并将其格式化为弹出菜单。菜单的值列表必须基于Table2,并包括Table2::ID和Table2::Description2;您可能只想显示第二列。
当您从菜单中选择一个项目时,FileMaker 将在 Table3 中添加一条具有所需 ID 的新记录(或者,如果您要修改一行,则更改现有记录)。
It's almost correct; you need to have a portal to Table 3, allow to create records via this relationship, place the Table3::Table2ID there, and format it as a pop-up menu. The value list for the menu must be based on Table2 and include Table2::ID and Table2::Description2; you'll probably want to only show the second column.
When you select an item from the menu, FileMaker will add a new record in Table3 with the required IDs (or change the existing record, if you're modifying a row).
第一步是创建值列表(这不是关系图的一部分)。您可以在“文件”>“文件”中执行此操作管理>值列表。
您可以创建一个新的值列表并告诉它使用字段中的值(第一个单选选项,未在图像中选择):
进入使用字段中的值对话框后,您可以选择同时显示第二个字段中的值(ID 是第一个,描述是第二个) ,包括所有值,并且仅显示第一个字段中的值(向用户隐藏 ID)。
您是正确的,您的关系图将为您完成创建相关记录并填写密钥的工作。它应该如下所示:
重要的是“允许通过此在此表中创建记录”在您的关系中检查了“关系”,如下所示:
你的布局,正如您所说,基于表一,您的门户查看表三。 “显示垂直滚动条”将允许您创建无限数量的相关记录。如果不选择该选项,您将受到门户中的行数限制。
就是这样。保存您的布局,在表一中创建一条记录,然后您可以通过关系图创建相关记录,而无需编写脚本。
您正在存储 ID 并显示描述。
The first step is to create your value list (and that is not a part of the relationship graph). You do this at File > Manage > Value Lists.
You can create a new value list and tell it to Use values from field (first radio option, not selected in image):
Once in the Use values from field dialogue, you can select to also display values from a second field (the id is the first, the description is 2nd), include all values, and only show values from the first field (to hide the id from the user).
You are correct that your relationship graph will do the work of creating related records and filling in the keys for you. It should look like this:
It is important that the 'Allow creation of records in this table via this relationship' is checked in your relationship, exactly as follows:
Your layout, as you said, is based on table one and your portal looks at table three. The 'Show vertical scrollbar' will allow you to create an unlimited number of related records. Without that option selected, you are limited to the number of rows in the portal.
That is it. Save your layout, create a record in table one, and you can create related records through your relationship graph with no scripting needed.
You are storing the id and displaying the description.