Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Form 表单 ID

Table Name 表名

leaveApplication

leave_application

leaveDetails

leave_details

Relationship: In this example,  the 'parent' form (leave application) has one 'child' form (leave details).

Creating the Child Form: leaveDetails

Image Removed

关系: 在这个例子中,“父”表单(leave application)具有一个“子”表单(leave details

创建子表单: leaveDetails

Image Added

首先,您将需要创建一个子表单或您想要嵌入到父表单中的表单。在子表单中添加一个将用于存储父表单的ID的字段。在这个例子中,我们添加了字段   First, you will need to create a child form or the form that you would want to embed in your parent form. In the child form, add a field that will be used to store the ID of the parent form. In this example, we added the field leave_application_id.

Creating The Parent Form创建父表单: leaveApplication

In the parent form, you can (optionally) add a field that will be used to store the ID of the child form. In this example, the field 在父表单中,您可以(可选)添加将用于存储子表单ID的字段。在这个例子中,字段leave_details_id has been added. This is only needed in situations where there is a one-to-one relationship between the parent form and the child form. You can then embed your child form in the parent form by dragging the Sub Form form element into the section that you want the subform to appear in.

Linking the Child Form to the Parent Form

Image Removed

Image Removed

To link the child form to its parent, you will need to edit the properties of the subform input that you added to your parent form in the previous step. The following fields are available:

  • Parent Field to keep Subform ID: ID of the field in the parent form that will be used to store the ID of the child form
  • Subform Field to keep Parent ID: ID of the field in the child form that will be used to store the ID of the parent form

Using Your Newly Created Form

When using your parent form in a process activity, the system automatically fills in the IDs of the parent and the child forms upon form submission.

One-to-One Relationship
In a one-to-one relationship, you will only have to select a form to be used in the subform properties. The child record will use the parent form ID as primary key.  In this case,
"Parent Field to keep Subform ID" can be set so that the parent form has a reference to the child record.

Sample data

  已被添加。 这种情况仅适用于一对一关联关系. 你可以把你想要子表单出现的表单元素拖拽到父表单中的Sub Form 中

将子表单链接到父表单

Image Added

Image Added

要将子表单链接到其父表单,您需要编辑上一步添加到父表单的子表单输入的属性。以下字段可用:

  • 父字段保留子表单ID:将用于存储子表单ID的父表单中字段的ID
  • 子表单字段以保留父表单标识:子表单中将用于存储父表单标识的字段的标识

使用您新创建的表单

在流程活动中使用父表单时,系统会在表单提交时自动填入父表单和子表单的ID。

一对一关系
在一对一的关系中,您只需选择要在子表单属性中使用的表单。子记录将使用父表单ID作为主键。在这种情况下,
“ 父字段保留子窗体ID ”可以设定父窗体有孩子记录的引用。

样本数据

表:leaveTable: leave_application

id

leave_details_id

....

1550

1550

....

Table: leave_details

id

leave_application_id

 

1550

1550

....