CodeCharge StudioCodeCharge Studio should then automatically switch to Code view.

CodeCharge Studio should then automatically switch to Code view.
//user_id_assign_by Label Handler Head @13-91DFA71C-->
public class tasksuser_id_assign_byLabelHandler implements LabelListener
{
public void beforeShow(CCSEvent e)
{
//End user_id_assign_by Label Handler Head-->
//Event BeforeShow Action Custom Code @13-4EFC2132-->
/* Write your own code here. */
//End Event BeforeShow Action Custom Code-->
//user_id_assign_by Label Handler Tail @13-F5FC18C5-->
}
}
//End user_id_assign_by Label Handler Tail-->
Replace the text:
/* Write your own code here. */
with the following:
if (e.getRecord().isEditMode())
{
e.getControl().setValue(DBTools.dLookUp("emp_name", "employees", "emp_id=" +
DBTools.toSql(e.getControl().getFormattedValue(),JDBCConnection.INTEGER,"IntranetDB"), "IntranetDB"));
}
else
{
e.getControl().setValue(DBTools.dLookUp("emp_name","employees", "emp_id="+
DBTools.toSql(Utils.getUserId(e.getPage()),JDBCConnection.INTEGER,"IntranetDB") , "IntranetDB"));
}
In the above code, the first "if" block checks if the current record form is in the update mode and if so, it retrieves the name of of the appropriate employee and assigns it to the current control's value. If the form is not in the update mode, the name of the currently logged in user is assigned as the control's value.
The following elements make up the code:
The whole code snippet reads approximately as follows:
Next: Add a Hidden "Assigned By" Field to Auto-Update New Tasks