Updating Foreign Record using Form Data Update Tool

Introduction

When a form is mapped to a process activity in Joget, the system automatically creates a record in the Application Form table using the Process Instance ID (PID) as the primary key. This allows seamless updates when using the Form Data Update Tool (Enterprise) to modify the same form. However, things can get complicated if you need to update a form that is not directly tied to the process flow. Joget won't be able to use the PID to locate and update the corresponding record.

How does it work?

To overcome this limitation, you need to define a field in the Update Fields section of the Form Data Update Tool. This field will serve as the identifier for the record you wish to update. Specifically, you should ensure that the Id field corresponds to the form's unique identifier, which isn't directly part of the process.

For example, consider the following scenario:

  1. Transaction Table (Mapped to Process Activity): This table is directly tied to the process and uses the PID as the primary key.
    Table Name transactions
    PK id
      name
    FK account_no
  2. Account Table (Not Part of Process Activity): This table has a foreign key relationship with the Transaction table but isn't directly mapped to the process activity.
    Table Name accounts
    PK id
      name
      expiry

In this case, the solution is to map the id field in the Update Fields section. State the value that corresponds to the form's record identifier.

Related documentation

Created by Julieth Last modified by Aadrian on Dec 13, 2024