CodeCharge Studio
Add a Hidden "Assigned By" Field to Auto-Update New Tasks
You've previously used the Before Show event to display the name of
the person who assigns the task. However, Label fields are not updateable by
nature, therefore even though the employee's name is displayed on the
page, it is not written to the database. Since we want the database to record
the name or id of the person who submits a task, we will need to add programming
logic to accomplish this.
- Add a Hidden field to your page from the Forms tab of the Toolbox.
This field type isn't visible in the browser, but will be used to store a value and update the database.
- Configure the new field by setting its properties as follows:
- Name: assigned_by - the name of the newly added Hidden field. This can be any name you choose.
- Control Source: user_id_assign_by - the database field/column that will be used to retrieve field's value and will be updated with the new value, if it changes.
- Data Type: Integer - the type of the value bound to the control source. Our user/employee ID's are numeric.
- Default: CCGetUserID( ) - CCGetUserID() is a CodeCharge function that retrieves the ID of the user that is currently logged in into the system. This way you can simply specify that you want to record the current user's id in the user_id_assign_by field for each new task that is being submitted.

Next: Add a Hidden "Date Created" Field to the Record Form
On-line, printable versions and updates