Protect

Description

The protection setting of a column. The Protect property overrides tab order settings. When a column is protected, the user cannot edit it even if the column’s tab order is greater than 0.

Applies to

A column

Syntax

Describe and Modify argument:

"columnname.Protect { = ' integer ' }"

Parameter

Description

columnname

The name of the column for which you want to get or set the protection.

integer

(exp) A boolean integer specifying whether the column is protected.

Values are:

  • 0 – False, the column is not protected.

  • 1 – True, the column is protected.

Integer can be a quoted DataWindow expression.

Usage

A user cannot change a column value if any one of these conditions is true:

Only the Protect property allows you to specify a conditional expression that protects some values in the column but not others.


In the painter

Select the control and set the value in the Properties window, Behavior category (using a conditional expression).

Examples

Example 1

setting = dw1.Describe("emp_stat.Protect")

Example 2

dw1.Modify("emp_stat.Protect=1")

Example 3

dw1.Modify("emp_stat.Protect='1~tIf(IsRowNew(),0,1)'")