Skip to content

Customize CustomDump

Patrick Tingen edited this page May 30, 2018 · 3 revisions

This hook enables you to perform extra actions or checks when dumping a record to disk. Datadigger makes a backup of any change you make (unless it is turned off in the settings). The signature of the procedure is this:

DataDigger will call this file with the following parameters:

Parameter Type Description
input pcAction character type of dump (Delete / Save)
input pcDatabase character name of the database
input pcTable character name of the table
input phData handle handle to a dynamic tt with the data to dump
input pcFilename character filename as suggested by DataDigger

The phData parameter is a handle to a temp-table that holds only the data you would like to dump. So it contains 1 record in case of a save action and 1 or more in case of a delete action.

You can give these parameters back to DataDigger:

Parameter Type Description
output pcMessage character a message to show the user
output plDefaultDump logical perform regular DD dump or not
output plContinue logical perform regular DD dump or not

pcMessage

This can be an informative message, a warning or an error. This will be shown to the user by DataDigger.

plDefaultDump

This tells DD whether to perform its own dump or not.

plContinue

This tells DD whether the action should be committed. You can use this to prevent certain delete or save actions.

Note that if you do your own dump, using the filename DD suggests in pcFilename and you set plDefaultDump to TRUE, DD will overwrite your file because it too uses this filename to dump its data.

Example

The below example will – in case of a delete action – ask the user whether she still wants to delete the data. To be honest, this is really annoying behavior, but for the sake of giving an example, it will suffice 🙂

Note that we use the OUTPUT parameter plContinue for the answer of the user. If she answers NO, then DataDigger will cancel the delete action.