Progress
ADM 2 Reference
addRecord (viewer.p)
Initiates the creation of a new record in the RowObject temp-table. Initial values for the new record are displayed in the viewer’s frame. Keeps a running total of the records added.
Parameters: NoneReturns: Nothing (procedure).Notes:
- addRow() is invoked in the update target, which creates the new RowObject temp-table record and returns the column values. When the SmartDataViewer is a GroupAssign target, its GroupAssign source has already added the record, therefore only the values of the columns are retrieved.
- Column values are passed to displayFields, which displays the values in the viewer’s frame.
- The record is not actually created in the database until it is committed. This is done in assignDBRow procedure.
- For Add and Copy, it is important that key fields, and any other fields assigned by the CREATE trigger, not be set to updateable in the SmartDataObject and enabled for data entry. If they are, the screen values are assigned on top of the key values set by the trigger, with an error as the likely result.
- applyEntry is run to apply entry to the first field in the frame after the initial column values are displayed.
- The procedure submitForeignKey in
data.p
automatically assigns key values inherited as ForeignField values from another SmartDataObject. For example, in an Order SmartDataViewer used for adding new Orders for the current Customer selected in another object, the CustNum field can (and normally should) be left disabled in the Order SmartDataViewer. Its value is assigned in the Order SmartDataObject to the CustNum value from the parent Customer SmartDataObject at the time the new record is Saved. You can override submitForeignKey in the SmartDataObject your Data visualization object is connected to in order to write any additional special logic you want to apply when adding or copying a record.- addRecord is invoked when an Add is initiated, typically by choosing the Add button in an Update SmartPanel, or the Add button or Add menu item in a SmartToolbar.
- addRecord republishes the addRecord event to handle the Add for GroupAssign targets.
- addRecord can be customized when additional processing is needed at the start of an Add operation. Keep in mind that when an addRecord override is invoked, the new record has not yet been created, and there is no transaction active.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |