Form Record Locking Form Element

Introduction

The Form Record Locking Form Element allows you to lock a record from being edited by other users for a specified period (in minutes). This feature ensures that only one user can edit a form at a time, reducing the risk of data conflicts.

Get started

To see how the Record Locking form element functions, you should first create a form.

Where to get the plugin

You can download the plugin from the GitHub repository.

How to install

  1. Download the plugin's JAR file from the Initial Release page on GitHub.
  2. Log in to your Joget platform as an admin.
  3. Go to Admin Bar > Systems Settings > Manage Plugins.
  4. Click the Upload Plugins button.
  5. Select the downloaded JAR file and click Upload.
  6. Verify the installation under the Installed Plugins tab.
Note: Uninstall any previous plugin versions before uploading a new one.

The Joget DX 8 Knowledge Base has more information on managing and developing plugins.

How to use it

  1. Start the Joget server and open the App Center.
  2. Log in as admin, click Design New App, or select an existing one.
  3. Fill in App ID and App Name, then click Save.
  4. Create a new form by filling in Form ID, Form Name, and Table Name. Click Save.
  5. Add a Text Field with the ID set to name.
  6. Drag and drop the Record Locking Form Element into the form.
  7. Configure the Record Locking element as needed and Save the form.
  8. Click the Generate App button and generate a CRUD interface.

  9. After creating the CRUD, Launch the UI.

  10. Create a new record and save it.
  11. Log in as a different user (e.g., username: cat, password: password) and go to the record you created. Attempt to edit it.
  12. Observe the timer. Reload the page to see the remaining lock time.
  13. After the lock duration expires, the second user should be able to edit and save the record.

Configure form record locking properties

Fields to configure:

  • Label: Display label for the end-user.
  • ID: Unique element ID (e.g., title creates a corresponding database column c_title).
  • Lock Duration: Time duration for which the record will be locked.
  • Display Name Format: Formatting the username of the person who locked the record.
  • Validator: Attach a validator plugin for input validation.
    When will validation take place?
    Validation will occur whenever a form is submitted except when submitted as Save as Draft.
  • Form: Select the form to be locked from editing.

Record locking validator

The Record Locking Form Validator is not meant to be used for Regular use cases. The validator's error message is only accessible to advanced users through editing the form page's source code. For example, since the Record Locking Form Element does not allow the users to save a locked record (the Save button is hidden), an advanced user can attempt to circumvent this by inspecting another page's source code and copying the save button HTML element and try to save the form; This is where the Record Locking Form Validator can be used, as it would still deny the user from saving the form even though the Save button is shown.  

Fields to configure:

  • Error Message: Message to be displayed when the user tries to manipulate a locked record.
  • Form: Select the form to be locked from editing.

Expected outcome

Once configured, the form will prevent other users from editing records for the specified time. Users will see a timer indicating when the lock will expire.

Created by Julieth Last modified by Aadrian on Nov 19, 2024