问题描述
我有一个名为ProductFamily
的表格.它有一个名为ProductFamilyMBValues
的字段,它是一个字符串列表.
I have a form called ProductFamily
.It has a field called ProductFamilyMBValues
which is a list of strings.
我有一个名为Item
的表单的响应文档,它始终是使用上述表单的文档的响应.
I've got a response document using a form called Item
, which is always a response of a document using the above form.
Item
表单的dialoglist
字段ItemMakeBuy
具有验证公式@If(@Length(ItemMakeBuy) = 0;@Failure("You must choose a Make or Buy value");@Success)
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)
该字段的选择是一个公式:@IfError(@GetDocField($ref;"ProductFamilyMBValues");"?")
.
The choices for that field is a formula: @IfError(@GetDocField($ref;"ProductFamilyMBValues");"?")
.
我的问题是,当我创建一个新的Item
文档时,没有填充ItemMakeBuy
字段的选择,这似乎是因为直到保存该文档后,才会填充$ref
字段.但是,由于验证公式的原因,我无法保存它,要求输入一个值.
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.
推荐答案
在创建响应时,您是否还会从父级复制任何其他字段?如果将UniversalID复制到响应中,则可以使用它,直到保存文档为止.如果在公式中与@IsNewDoc
结合使用,则保存文档的那一刻可以指向$ REF.
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.
或者类似这样的东西:@IfError(@GetDocField($ ref;"ProductFamilyMBValues"); @ GetDocField(ParentUNIDField;"ProductFamilyMBValues"))
Or something like this: @IfError(@GetDocField($ref;"ProductFamilyMBValues");@GetDocField(ParentUNIDField;"ProductFamilyMBValues"))
这篇关于在创建文档时引用父字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!