GetValidate

Description

Obtains the validation rule for a column in a DataWindow.

NoteGetValidateByColNum A separate method name is provided as an alternative syntax for the Web DataWindow server component, which cannot use overloaded methods.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object

Web

Server component

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

PowerBuilder

string dwcontrol.GetValidate ( string column )
string dwcontrol.GetValidate ( integer column )

Web DataWindow server component

string dwcontrol.GetValidate ( string column )
string dwcontrol.GetValidateByColNum ( short column )

Web ActiveX

string dwcontrol.GetValidate ( string column )
string dwcontrol.GetValidate ( number column )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow.

column

The column for which you want the validation rule. Column can be a column number or a column name. The column number is the number of the column as it is listed in the Column Specification view of the DataWindow painter—not necessarily the number of the column in the Design view.

Returns

Returns the validation rule for column in dwcontrol. Returns the empty string (“”) if no validation criteria are defined for the column.

If any argument value is null, in PowerBuilder and JavaScript the method returns null.

Usage

You can use GetValidate to save the current validation rule before calling SetValidate to change the rule temporarily.

Examples

Example 1

These statements change the validation rule for column 7 in the DataWindow control dw_Employee to Rule2:

string Rule1, Rule2 = "Long(GetText()) > 15000"

Rule1 = dw_Employee.GetValidate(7)

dw_Employee.SetValidate(7, Rule2)

See also