CodeCharge Studio' Write your own code here.with the following lines (ASP/VBScript):
If tasks.user_id_assign_to.Value = Session("UserLogin") Then
tasks.task_name.Value = "<b><font color=""blue"">" & tasks.task_name.Value & "</font></b>"
End if
If tasks.user_id_assign_to.Value = Session("UserLogin") Then
This is an if condition that is true only if the value of user_id_assign_to label is equal to the login name of the employee that is currently logged into the system. Once you login to the system, the program will recognize your tasks by comparing your login name to the field value of the person that a task is assigned to.
UserLogin is one of the session variables used by CodeCharge-generated programs, and it holds the Login name of the currently logged in user until the session expires.
Note:
The following are all default session variables created by CodeCharge Studio:
tasks.task_name.Value = "<b><font color=""blue"">" & tasks.task_name.Value & "</font></b>"
The above code is executed if the previous if condition is met. It modifies the value of the task_name field. The field value is replaced with its database value wrapped within HTML code that specifies the font color as blue, and adds HTML <b> tag to make the font bold as well.
Notice that the word blue has double quotes around it, which will be replaced with a single quote. Since quotes mark the start and end of a string, using double quote allows you to insert a quote into a string.
Additionally, notice that the code is object-oriented and you specify that you want to assign a value to the task_name field in the tasks grid. Value is a property of that field, which you can both read and modify.
End if
This line marks the end of the if condition, so that the execution of the remaining code is not affected by this condition.
Next: Preview Tasks List Page