OnPreCopyCompare method: AdsValidationBase class
Syntax
OnPreCopyCompare(&ADS_rowset, ADS_name)
Description
This method will be automatically invoked for each ADS instance when ADS projects are copied or compared unless the method is overridden in the derived application class for the current ADS definition. If the method is overridden, then the overriding method from the derived class will be automatically invoked. During copy, this method is called for all objects in the project before any objects are copied so that a single validation error anywhere in the project will prevent any objects from being copied.
The definition of this method in the base class is an “empty implementation.”
If this method encounters a validation error, it should invoke the ReportErrorModified method to store the error in the database so that it can be reviewed later on the Validation page.
Parameters
| Parameter | Description |
|---|---|
|
&ADS_rowset |
Specifies the current ADS rowset instance as a rowset object. The rowset contains the data from the source project file. |
|
ADS_name |
Specifies the name of the current ADS definition as a string. |
Returns
A Boolean value: True if pre-copy compare validations succeeded, False if any errors were encountered.
Example
import PTADSDEFN:AdsValidationBase;
class AdsValidationSample extends PTADSDEFN:AdsValidationBase
method AdsValidationSample(&ProjectName As string);
method OnPreCopyCompare(&ADSRowset As Rowset, &ADSName As string,) Returns boolean;
end-class;
method AdsValidationSample
/+ &ProjectName as String +/
%Super = create PTADSDEFN:AdsValidationBase(&ProjectName);
end-method;
method OnPreCopyCompare
/+ &ADSRowset as Rowset, +/
/+ &ADSName as String +/
/+ Returns Boolean +/
/* place code to validate the input rowset here */
end-method;