Versions Compared

Key

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

Table of Contents

Introduction

English
The ID Generator Field is used to produce a running number based on an App Variable.  To learn more about its usage, refer to Generate Reference ID.
Note

You will only need to do this if you are using MySQL, as other databases already default to "READ-COMMITTED".

Run the following queries in MySQL.

SET GLOBAL tx_isolation='READ-COMMITTED';
SET SESSION tx_isolation='READ-COMMITTED';


You will also need to set the following in your my.cnf/my.ini file.
[mysqld]
transaction-isolation = READ-COMMITTED

...

  1. Start the Joget Server and open the App Center.

  2. Log in as admin and click on the pencil icon on the Expenses Claim to open the App Composer (see Figure 1).
    Image RemovedImage Added
    Figure 1

  3. Under Form Builder column, click on Expense Claim New (see Figure 2).


    Figure 2

  4. Click on  the ID Generator Field element on the canvas to open up the Configure ID Generator Field properties. (see Figure 3)


    Figure 3

  5. Take note of the Format.

  6. To see it working, head back to the App Composer and click the Launch button in the UI column.

  7. Click on Create a New Expense Claim button on the Dashboard, fill up the necessary details and click Continue Next Screen button. 

  8. Click on Save As Draft button.

  9. Go to My Expenses on the menu to the left and click on My Inbox.  Here you can see the ID generator has generated a 4 digit running number (as defined in the Format field in steps 4 & 5) under the # column (see Figure 4).


    Figure 4

...

NameDescription
ID

Element ID (By declaring as "ref", a corresponding database table column "c_ref" will be created)

Please see Form Element for more information about defining the ID and list of reserved IDs.


Warning
titleNote when using this element when the form is part of a workflow process

Do not set the id as "id" when the form is used as part of a workflow process. The value generated by this element will not be associated with the process instance's ID.

LabelElement Label to be displayed to the end-user.
App Variable Name

Name of the app variable to be used to keep the running number.

Format

Determines the pattern of the generated value (e.g., "REF-?????" will yield "REF-00001")


Advanced Options

Image RemovedImage Added

NameDescription
Hidden?

Determines if the element should be made visible in the form.

Workflow Variable

If the form is part of a workflow process, upon saving of the form (by clicking on "Save as Draft" or "Complete" button). The value in this input field will be saved into the corresponding workflow variable named here.

Info
titleUsing a non-existent Workflow Variable name

You will get the following warning with the name printed out (e.g. status) in the server log if you attempt to map to a non-existent Workflow Variable.

Code Block
context attribute status does not exist in process context - adding new attributes to the process context is not allowed

 

Distributed Unique ID

Generates a distributed sequential unique ID.

Note

It is advisable to use Distributed Unique ID when dealing with high loads of ID generation to avoid performance bottleneck.

Related Documentation 

Generate Reference ID