Previous Topic: Delete Object (DLTOBJ)

Next Topic: USER: Processing Before Data Read

USER: Processing Before Data Update

CA 2E performs referential integrity checking on the data input of an application. If you want to delete data, you must perform your own checking in the action diagram. If you want to prevent the deletion of a record with references to it, insert a call here to a RTVOBJ function based on the file to be checked, (that is, any file that refers to this file). Build the RTVOBJ function over a RSQ access path that is keyed by the foreign key fields. If a record is found, set the return code to *User QUIT requested; if a record is not found, set the return code to *Normal. Check the return code; if the return code is *Normal, quit the function and send an error message if necessary.

To perform a cascading deletion of subordinate file records, insert an EXCEXTFUN function containing separate RTVOBJ function calls for each file that potentially contains records to be deleted. For each RTVOBJ, define restrictor parameters based on the higher key order of the super ordinate file. This retrieves all possible records to delete. Insert a DLTOBJ function to delete each record in the USER: Process DBF Record user point of the RTVOBJ function.