在文档创建时引用父字段
我有一个名为 ProductFamily
的表单。 它有一个名为 ProductFamilyMBValues
的字段,它是一个字符串列表。
我有一个使用名为 Item
的表单的响应文档,它始终是使用上述表单的文档的响应。
Item
表单有一个 dialoglist
字段 ItemMakeBuy
,其中包含验证公式 @If(@Length(ItemMakeBuy) = 0;@Failure (“您必须选择自制或购买值”);@Success)
该字段的选择是一个公式: @IfError(@GetDocField($ref;"ProductFamilyMBValues");"?")
。
我的问题是,当我创建新的 Item
文档时,ItemMakeBuy
字段的选择不会填充,似乎是因为在保存文档之前 $ref< /code> 字段未填充。但是,由于我的验证公式需要输入值,因此我无法保存它。
我该如何解决这个问题?理想情况下,我想保留该字段的验证公式。
I have a form called ProductFamily
.
It has a field called ProductFamilyMBValues
which is a list of strings.
I've got a response document using a form called Item
, which is always a response of a document using the above form.
The Item
form has a dialoglist
field ItemMakeBuy
that has the validation formula @If(@Length(ItemMakeBuy) = 0;@Failure("You must choose a Make or Buy value");@Success)
The choices for that field is a formula: @IfError(@GetDocField($ref;"ProductFamilyMBValues");"?")
.
My problem is that when i create a new Item
document the choices for the ItemMakeBuy
field aren't populated, seemingly because until the document is saved the $ref
field isn't populated. However, i can't save it because of my validation formula, requiring a value to be entered.
How can i get around this issue? Ideally i want to keep the validation formula for the field.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
创建响应时,您是否从父级复制任何其他字段?如果将 UniversalID 复制到响应中,则可以使用它直到保存文档。如果在公式中与
@IsNewDoc
结合使用,则在保存文档时它可以指向 $REF。或者类似的东西: @IfError(@GetDocField($ref;"ProductFamilyMBValues");@GetDocField(ParentUNIDField;"ProductFamilyMBValues"))
When creating the response, do you copy any other fields from the parent? If you copy the UniversalID to the response you can use that until the document is saved. If combined with a
@IsNewDoc
in the formula, the moment the document is saved it can point to the $REF.Or something like this: @IfError(@GetDocField($ref;"ProductFamilyMBValues");@GetDocField(ParentUNIDField;"ProductFamilyMBValues"))
这是引用父文档的逻辑方法,但 Notes 有另一种方法来获取父字段信息。在项目表单中,转到表单属性并选择“创建时:公式继承所选文档中的值”选项。然后,您可以在
Item
表单中创建任意数量的字段,并使用计算字段公式引用ProductFamily
表单中的字段名称,这些值将被传入。根据您的情况,您可以将 ProductFamilyMBValues 字段传递给响应文档。这里是 更多信息来自文档中的该主题。
That is a logical way to reference the parent document, but Notes has an alternate way to get at parent field information. In your Item form, go to the form properties and select the option "on create: formulas inherit values from selected document". Then you can create any number of fields in the
Item
form and use a computed field formula referencing the field name from theProductFamily
form, and those values will get passed in. In your case, you could just pass the ProductFamilyMBValues field to the response doc.Here is more information on that subject from the docs.
创建新文档时,您可以使用函数
@InheritedDocumentUniqueID
来获取父文档ID。在你的情况下,选择的公式是:
@IfError(@GetDocField(@InheritedDocumentUniqueID;"ProductFamilyMBValues");"?")
You can use the function
@InheritedDocumentUniqueID
to get the parent doc id when creating a new doc.In your case the formula for the choices would be :
@IfError(@GetDocField(@InheritedDocumentUniqueID;"ProductFamilyMBValues");"?")