Write New Records into Database (Insert, Copy)

The figure displays the functional sequence for inserting and copying records. You see the participating functions, the states the mask takes and the triggers set off. The triggering function is either the NoSelect function iwf_ins_elm (insert), the Select function iwf_dup_elm (copy), wdh_cop_pas PASTE (insert from special DataView-clipboard) or a drop operation. If you drop or insert several records at once, all triggers will be passed several times. If you install your own userexits at the Edit_, Pre_ or Post_Action trigger, for instance to perform special queries or checks within the functional sequence, you can evaluate the default parameter pr1 automatically passed by triggers. It informs about the current internal work mode of the mask (here C for Copy or I for Insert) and the current line number.


COPY&PASTE

With [Ctrl+C] you copy records from a source mask into the DataView-clipboard and with [Ctrl+V] from the DataView-clipboard into a target mask. In source lists you have to select the desired records, in source forms only the currently displayed record can be copied. The target mask is shifted into Insert mode of Mask-Edit state in the copying process. Then the functional sequence continues as shown in the figure.

It is a precondition for a successful copying process that the source and target mask are either identical or point to the same database table, or to database tables that are related to each other.

Data in invisible fields and in multilingual fields (i.e. data that are invisible because of the current language setting) are not copied.

COPY&PASTE events are default events and should not be changed in your application. Additional COPY&PASTE functions can be installed via wdh_cop_pas COPY or wdh_cop_pas PASTE in Select or Widget state.


DRAG+DROP

You can copy records from a list/form into another mask by selecting the records and move them to the target mask with the mouse button pressed. In the source list the Select_Action trigger will be active, because the records moved outside are automatically deselected. The target mask is shifted into Insert mode of Mask-Edit state. Then the functional sequence will continue as shown in the figure above.

It is a precondition for a successful copying process that the source and target mask are either identical or point to the same database table, or to database tables that are related to each other.

Data in invisible fields and in multilingual fields (i.e. data that are invisible because of the current language setting) are not copied.


OLE-DRAG&DROP

You can copy records from a DataView list/form into documents of OLE-aware MS-applications and vice versa.

DataView -> MS Application:
You select the desired records in the DataView source mask and move them into the target application with the mouse button pressed. In the source list the Select_Action trigger will be active, because the records moved outside are automatically deselected.

MS Application -> DataView:
You select the desired records in the MS application and move them into the DataView target mask with the mouse button pressed. The target mask is shifted into Insert mode of Mask-Edit state. Then the functional sequence will continue as shown in the figure above.

DataView checks the data while inserting them using any installed userexits at the Pre_ or Post_Field trigger. If a userexit allows no field entry, the OLE-Drag&Drop will be cancelled at this field.

Data in invisible fields and in multilingual fields (i.e. data that are invisible because of the current language setting) are not copied.


Insert and Copy in Combined Forms

If the header form of a combined form is set to Insert mode of Mask-Edit state via iwf_ins_elm, iwf_dup_elm or wdh_cop_pas PASTE all sub-masks (in case of sub-masks on index cards only the currently displayed one) will automatically be in that state. In an item form with suppliers sub-list for instance you could enter a new item in the header form and select or enter a first supplier in the sub-list.


Lock Insert or Copy Events for Individual Masks

If you defined an event in your application that inserts or copies data via iwf_ins_elm, iwf_dup_elm or wdh_cop_pas PASTE, these operations are possible in each active mask, as opposed to mask-specific items or buttons defined for that. In order to lock insert/copy functions for individual masks you can install cch_nop_ins or cch_nop_cop at the Edit_Action trigger of these masks. The userexit cch_nop_ins prevents all insert and copy operations; the userexit cch_nop_cop prevents all copy operations.