The way to specify a return code in a DataWindow event is different in each of the DataWindow environments.
Use a RETURN statement as the last statement in the event script. The datatype of the value is long.
For example, in the ItemChanged event, set the return code to 2 to reject an empty string as a data value:
IF data = "" THEN
RETURN 2
In client events, use a return statement as the last statement in the event script. The datatype of the value is number.
For example, in the ItemChanged event, set the return code to 2 to reject an empty string as a data value:
if (newValue = "") {
return 2;
}
Use the SetActionCode method of the Web ActiveX control. The datatype of the value is number.
For example, in the DBError event, suppress the standard error message by setting the return code to 1:
dw_1.SetActionCode(1);
Use the setReturnCode method of the event object passed to the event. The datatype of the value is int. The setReturnCode method is inherited from the parent EventData class.
For example, in the retrieveStart event, prevent the DataWindow from being reset, so that the newly retrieved rows as appended to the rows already retrieved:
event.setReturnCode(2);