Inserting Records (Recordset Operations dialog box)

Some hosts allow you to directly insert records as part of a recordset on an entity. Use the options in this dialog box to configure your model to execute an operation before and after a single record insertion. If your host supports multiple record inserts, select the Host supports multiple record inserts check box described below and configure the model to instantiate the insertion using a combination of an operation stored in the model file and the new InsertRecords method available in your preferred Host Integrator connector.

Select the Host supports direct insertion check box and choose from the options described below.

If you attach an event handler to the recordset that has an Insert Record event implemented, a lightning bolt ( ) is displayed to the left of this option. This is a reminder that the event handler may include logic that overrides or extends any of the settings you configure below.

Insert at first blank record
Select this option if the host allows you to insert a new record into the first blank record that appears on the terminal screen.

Insert at first record with these properties
Select this option and click the Edit button to open the Condition Edit dialog box. Specify certain properties to look for in a record, so the Host Integrator can alert the user that direct insertion of data is now possible. Note: If you select this option, you will not be able to exit this dialog box until a condition is specified.

Execute operation before insert
Select this check box and map an operation to execute before inserting a new record.

Tip: Executing an operation before or after a record is inserted is often helpful when working with character mode applications. For example, you may want to create an operation that uses the MoveCursor command to position the cursor on the entity before a new record is inserted. After the record is added, create another operation that transmits the cursor to the next position. You could also create an operation that transmits a terminal key using the TransmitTerminalKey command to alert the host that a new record is about to be added. Then, create another operation that tells the host the insertion is complete.

Execute operation after insert
Select this check box and map an operation to execute after inserting the new record.

Host supports multiple record inserts
Select this check box if the host allows you to insert more than one record in a recordset of an entity.
If you have configured an operation that executes prior to or after a group of records is to be inserted, invoke the operation using the new PerformEntityOperation method available with your preferred Host Integrator connector instead of the using the options in this dialog box. Use the Recordset Test dialog box to make sure your records are being properly added to the recordset.

Modifying records in a recordset from the Design Tool can create synchronization problems between the Design Tool and the host. For example, if Host Integrator inserts the first record in a recordset and there are no indicators that it should wait for the host to commit to a modification and make a new blank record appear, Host Integrator reports this as an error. The problem is that the Design Tool refreshes the internal view of the screen in the Terminal window before the host has received the new data. To fix this, create an operation that uses one or more Host Events commands that makes Host Integrator wait until the host is done returning the new input record. Then, select the Execute operation after insert check box described above and choose the configured operation from the list.