AddRecord

Inserts assembled data into the database table specified by a previous SetTableName action.

Syntax

bool AddRecord ()

Parameters

None.

Returns

False if there is no connection to the database; if an error occurs when the action attempts to add the record to the database; or if a SetTableName action was not previously used. Otherwise, True.

Level

All, but generally used at the Page or Field level.

Details

Inserts assembled data into the database table specified by a previous SetTableName action.
Important: This action must be placed after earlier actions that gather data, open the database, and access the correct table.
Example:
SetTableName("Invoice")
ExportFieldToColumn("VendorID,db_Vendor")
ExportFieldToColumn("Number,db_Number")
ExportFieldToColumn("Total,db_Total")
AddRecord()      

This ExportDB rule applies to a Page object of the Document Hierarchy.

The actions open the database and direct the rule's attention to the Invoice table. The rule then sets up a record with three values - Vendor ID, Invoice Number and Total. Afterwards, the AddRecord action updates the table with new information.

Note: A return of False means the record may not have been successfully exported, and needs to be followed by a failure check rule that typically would call SetTaskStatus(0) (or the rrunner action rr_AbortBatch) to ensure that the batch aborts.