Adding Timestamping
Changes to a memo field can be time-stamped. For example, you can time-stamp the changes, comments, notes, and follow-ups that are added to an issue description over time.
Timestamping requires two memo fields, one for input and one for storing the timestamped log. When an issue is saved, the Web view automatically copies the contents of the input field to the log field.
1 Use the Field Editor to create a memo field for input of new data, and a field for displaying the timestamped log. For the input field, clear the Show in Choice Lists and Maintain Revision History check boxes.
2 Find the internal name of the timestamp log field. The internal name looks like mem_58_mem_58_FieldName.
If you have Microsoft Access, you can find the internal name by opening the project definitions database and looking in the tblDtsFields table. The field name is composed from the values in the nID and tBoundControlName fields:
mem_<nID>_<tBoundControlName>
The tBoundControlName field includes a repeat of the mem_<nID> string. That is why the string appears twice in the name.
If you don’t have a copy of Microsoft Access, generate a Web view for the project, then get the value of the name attribute of the text area control associated with the timestamp log field. You can find this in the tmplRecord.html file located in the HTML folder of the view:
CensusWebVD\<project>_<view>\HTML
3 Set the HTML code after control attributes:
Before you generate a Web view, you must export the two fields and set their HTML code after control attributes.
a For the input field, enter this HTML code (as a single line of text):
<script type='text/javascript'>document.write
( parent.objCustomCode.getCodeAfterField( '%fieldname%', '<timestamp-log-field-name>' ) ) </script>
<timestamp-log-field-name> is the field name you found in the previous step. Note that the javascript is case sensitive.
b For the timestamp log field, enter this HTML code (as a single line of text):
<script type='text/javascript'>document.write
(parent.objCustomCode.getCodeAfterField('%fieldname%','' ) )</script>
Related Topics