4D v14.3ADD SUBRECORD |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
ADD SUBRECORD
ADD SUBRECORD
Subtables are no longer supported starting with version 11 of 4D. A compatibility mechanism ensures the functioning of this command in converted databases; however, it is strongly recommended to replace any subtables with standard related tables. The ADD SUBRECORD command adds a new subrecord to subtable, using the form form. ADD SUBRECORD creates a new subrecord in memory, makes it the current subrecord, and displays form. A current record for the parent table must exist. If a current parent record does not exist for the process, ADD SUBRECORD has no effect. The form must belong to subtable. The subrecord is kept in memory (accepted) if the user clicks an Accept button or presses the Enter key (numeric pad), or if the ACCEPT command is executed. After the subrecord has been added, the parent record must be explicitly saved in order for the subrecord to be saved. The subrecord is not saved if the user clicks a Cancel button or presses the cancel key combination (Ctrl-Period on Windows, Command-Period on Macintosh), or if the CANCEL command is executed. After a call to ADD SUBRECORD, OK is set to 1 if the subrecord is accepted, to 0 if canceled. The form is displayed in the frontmost window of the process. The window has scroll bars and a size box. Specifying the optional * parameter causes the window to be drawn without scroll bars or a size box. The following example is part of a method. It adds a subrecord for a new child to an employee’s record. The data for the children is stored in a subtable named [Employees]Children. Note that the [Employees] record must be saved in order for the new subrecord to be saved: ADD SUBRECORD([Employees]Children;"Add Child") Accepting the subrecord sets the OK system variable to 1; canceling it sets the OK system variable to 0. |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v11 SQL SEE ALSO
ACCEPT ARTICLE USAGE
4D Language Reference ( 4D v11 SQL Release 6) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||