Recording Date of Checkbox Activation

Confluence User - 02 Dec, 2016

Hello Friends,

I have created a form where I would like to record the date and time that a checkbox is checked.  The use of this feature is so that when a certain individual reviews the form and provides their input, they will check a checkbox indicating that their portion of the review is complete, and I would like to record the date and time that this took place.  I suppose that this will only be recorded once the form contents have been "saved" using the save button on the form.  Since many different people will be checking different checkboxes when they do their own review, this date and time record cannot simply be tied to when the form is saved, but rather, must be correlated to the individual checkbox.

Any advice?

Many thanks in advance...

forms

2


02 Dec, 2016
confluenceUser
confluenceUser

One way this can be achieved is,
1. Create a 'review form' with checkbox(with all options), 'parent id' to capture 'process id' and an 'id' field which is unique. As this is one to many 'id' is required. 'Reviewed By' field can also be added if needed.
2. Use the 'review form' in your main form.
3. When a user selects a check box and saves it, the record gets updated in the 'review form' table with date & time. If date & time is not recorded by default, you can use hidden field in 'review form' to capture date & time.
4. Loop the process to the same activity till all check boxes selected. This can be achieved through workflow variables & routing task in the process design.

All related dates can be retrieved using the 'parent_id' and displayed through form / list grids.
There could be better ways as well!

02 Dec, 2016
confluenceUser
confluenceUser

Hi Kevin Swett

The "HR Expenses Claim App" that comes standard in your Joget Workflow installation has an example of capturing audit trail in a form.

The parent form "HR Expense Approval Form" has one subform "HR Expense Approval Entry" that records every approval submission. This subform automatically store the username of the approver using hidden fields and #currentUser.username# hash. You can add many other hidden fields; for example to store the date and time #date.yyyy-MM-ddof the save action. You an also use hidden fields to store the state of any fields in the parent form and use javascript to "push" the value to the subform child fields for audit trail storage.

How can a subform become an audit trail record? This is achieved by setting the subform properties "Load Binder" to "Bean shell form binder" and the value "return null;" (meaning 'do nothing/don't load any records, causing every save to be a new record.'). Of course, the subform table must be a new table name (must not be the same table name as the parent form). Remember to create a hidden field in the subform to store the "Subform Field to keep Parent ID" foreign key value. This maps the parent id to the child records.

The 'audit trail' records can then be retrieved and displayed in the another parent form using form grid.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print