OnPreUpdate method: AdsValidationBase class

Syntax

OnPreUpdate(&ADS_rowset, ADS_name)

Description

This method will be automatically invoked after all data in each distinct ADS name in the project has been 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.

If errors are detected by this method, subsequent data will not be copied, but any data already copied to the database will not be rolled back.

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 OnPreUpdate(&ADSRowset As Rowset, &ADSName As string,) Returns boolean;
end-class;

method AdsValidationSample
   /+ &ProjectName as String +/
   %Super = create PTADSDEFN:AdsValidationBase(&ProjectName);
end-method;

method OnPreUpdate
   /+ &ADSRowset as Rowset, +/
   /+ &ADSName as String +/
   /+ Returns Boolean +/
   /* place code to validate the input rowset here */
end-method;