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
tableViewName
is specified, the command is applied according to thetableViewScope
parameter. Since the entire table view tree might not be included, this is known as a partial command, andsm_tm_command
setsTM_FULL
to0
.If
tableViewName
is 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_command
setsTM_FULL
to 1.tableViewScope
- One of the following parameters, which must be preceded by a table view name.
TV_AND_BELOW
which 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_BELOW
was supplied.
BELOW_TV
which applies the command to the table views below the specified table view.
TV_ONLY
which applies the command to the specified table view only.
SV_ONLY
which applies the command only to the table views of the specified server view.
NEW
clears each field and prepares it for data entry. To insert data successfully, all the fields in a table view that are participating in theSQL
INSERT
statement 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
,COPY
orSELECT
, 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 selectNEW
again.- 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
NEW
command can choose to set the class property tonew_button
. By default,new_button
is active in initial and view modes.
To save the additions, select
SAVE
as the next transaction command. To discard the additions, selectCLOSE
orFORCE_CLOSE
.If you are entering a series of rows,
COPY
copies 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
NEW
command 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
)