This tab has three sections.
These settings determine how and when the attribute takes on values.
Default Value section
The Type item is used to specify a default value for the field. When a user creates a new document, this value will appear without the user having to enter anything in the field.
• None: The attribute will not have a default value.
• Fixed: Lets the administrator specify a constant (fixed value) that is the default for the attribute. Users may override the default value, but the default value will remain constant.
• Select: Lets the administrator enter a standard Structured Query Language (SQL) SELECT statement in the field. Using this option, the default value can be pulled from a table in the database. One such example would be:
This would result in the current user’s description entered as the default value for the attribute field.
• System variable: Lets the administrator enter a valid system variable to serve as the default value for the attribute. To see a list of valid system variables, click the browse button by the value entry. One such example would be: $DATE$
This would result in the current date entered as the default value for the field. • Function: Lets the administrator to enter a function name within a DLL using
the browse button in the value entry. This item is typically used when custom development work is being done using the ProjectWise SDK.
Update Value section
This section allows an administrator to set up rules that govern when the attribute is automatically updated, and what value is inserted. It has the same options as the Default value section to set the values.
Any field can be automatically updated when another defined field changes, or when any field changes. The value updated can be a fixed value, the result of an SQL SELECT statement, a value returned by a user defined function or a system variable or project property. You can define multiple fields to trigger the automatic update, so that the update occurs when any of the fields change, or you can set the field trigger to update whenever the record is updated.
• The SELECT statements used to update a field or enter a default value will usually contain a WHERE clause to limit the number of records returned to a single value.
Suppose the environment contains the fields author, title, and date_of_birth. It contains a table named authors, that has the fields name, title, and
date_of_birth for a number of authors. You might use a pick list in the author field to select the author's name from the authors table by using the following SELECT statement:
SELECT name FROM authors ORDER BY authors;
Having selected an author, you probably want to fill the title and
Attributes Properties Dialog
making the author field a trigger field for the title and date_of_birth fields and using the SELECT statements:
SELECT title FROM authors WHERE authors.name = '$EDIT#author$;' and
SELECT date_of_birth FROM authors WHERE authors.name = '$EDIT#author$;'
Note: This assumes that the name field in the authors table is unique.
The system variable $EDIT#field_name$ provides the means of specifying the value of another field in the current record. When using this system value in a SELECT statement, you must enclose it in single quotes”
'$EDIT#field_name$'
• You can also call a function when a field is updated. In this case, you enter the name of the function and the name of the file containing it into the
parameters field.
For example, suppose you have another field in the environment table called log_file and you have written a function called UpdateLogFile contained in a dynamic link library update.dll. If you designate the log_file field's automatic update source to be a function and enter the parameters
UpdateLogFile;update.dll, then the UpdateLogFile function is called when the field is triggered.
• The value for an update can also be derived from a system variable or project property. In this case, you enter the name of the system variable or project property in the parameters field.
• Suppose the environment table contains the fields drw_date and chkd_by. These fields can be automatically updated when any change is made to a record by setting the trigger to update when the attribute record is changed (the default value) and setting the source of update to System Variable. You
would enter the system variable $DATE$ as the parameter for the drw_date field and $USER$ as the parameter for the chkd_by field.
Two options that control when the attribute is updated. • Update field when the attribute record is updated:
Selecting this option will update the attribute when any field in the record is updated.
• Update field when some attribute column(s) is updated:
Selecting this option will update the attribute when specific fields in the record are updated. The user will then be prompted to select the fields to trigger the attribute update.
Value List section
This section lets the administrator generate pick-lists in association with the Attribute. The pick-list can be generated using the same methods as described previously for Default value with the exception of the Fixed method. Since this method only produces one result, the fixed value, it is not relevant when creating a list of values from which the user will select. In addition to the methods for generating the pick-list, this section also has the following settings:
• Limit to list:
This option forces the user to select an item from the list, or to leave the item blank. They cannot key in a value that is not in the list.
• Multiple selection:
Environment and Attribute User Properties Settings