![]() | Programming Guide | ![]() |
Prepares screen for data entry
int sm_tm_command ("NEW [tableViewName[tableViewScope] ]");
tableViewName- The name of a table view in the current transaction. A table view can only be specified if the mode has already been set to new. This parameter is case sensitive.
If
tableViewNameis specified, the command is applied according to thetableViewScopeparameter. Since the entire table view tree might not be included, this is known as a partial command, andsm_tm_commandsetsTM_FULLto0.If
tableViewNameis not specified, the command is applied for each table/server view, starting with the root table view. This is known as a full command, andsm_tm_commandsetsTM_FULLto 1.tableViewScope- One of the following parameters, which must be preceded by a table view name.
TV_AND_BELOWwhich applies the command to the specified table view and all table views below it on the tree. If no parameter is specified, the transaction manager acts as thoughTV_AND_BELOWwas supplied.
BELOW_TVwhich applies the command to the table views below the specified table view.
TV_ONLYwhich applies the command to the specified table view only.
SV_ONLYwhich applies the command only to the table views of the specified server view.
NEWclears each field and prepares it for data entry. To insert data successfully, all the fields in a table view that are participating in theSQLINSERTstatement need to have the same number of occurrences.After you select
NEW, the following steps occur:
- If you have made changes in the table views on which this command operates in a previous
NEW,COPYorSELECT, you are prompted to discard your changes. If you chooseOK, changes are discarded and fields in the specified table views are cleared. If you chooseCancel, you return to the screen so you can save your changes. You must then selectNEWagain.- The fields are cleared of all previous values.
- The transaction mode is set to
new. By default, this mode clears all the protection bits in updatable table views to reflect that data entry is available in those widgets.- Before image processing for the screen is enabled. Any changes made to the screen following this step can then be processed using
SAVE.Push buttons and menu selections for the
NEWcommand can choose to set the class property tonew_button. By default,new_buttonis active in initial and view modes.
To save the additions, select
SAVEas the next transaction command. To discard the additions, selectCLOSEorFORCE_CLOSE.If you are entering a series of rows,
COPYcopies the data on a screen so it can then be edited, without having to enter the data again.
The following requests can be generated by the
NEWcommand to ascertain whether the changes from the previous command have been saved and, if desired, discard those changes:
TM_PRE_CLOSE(described underCLOSE)
TM_CLOSE(described underCLOSE)
TM_QUERY(described underCLOSE)
TM_DISCARD(described underCLOSE)
TM_POST_CLOSE(described underCLOSE)
![]()
![]()
![]()
![]()