Insert function

Official Content
This documentation is valid for:

Returns TRUE when the Transaction is in Insert mode. Otherwise, it returns FALSE.

Syntax

Insert

Type Returned:

Boolean (True or False)

Note

In the iSeries environment, when an error rule for a certain mode is defined, the corresponding code to support this mode is not generated.

Example

Products Table

ProductCode*
ProductDescription
ProductStock
LastPurchasePrice
LastPurchaseDate

LastPurchasePrice and LastPurchaseDate, respectively, store the price and date of the last completed order for ProductCode.

The assignment of attributes may be defined within Transaction rules. Such assignment implies an update of the base table of the current level, or of some of the tables belonging to the extended table of the current level.

The updating of attributes LastPurchasePrice and LastPurchaseDate is done by defining the following rules in the Orders Transaction:

LastPurchasePrice = OrderPrice if Insert;
LastPurchaseDate  = OrderDate  if Insert;

So, every time a new line is added to the order, the Products table is updated with the relevant date and price.

Scope

Objects    Transaction object

See also

Update function
Delete function