Official Content

Returns True when the Transaction is being executed in Insert mode. Otherwise, it returns False.

Syntax

Any valid Transaction rule if Insert;

Type Returned:
Boolean (True or False)

Scope

Objects: Transaction

Description

The Insert function allows conditioning the triggering of a rule defined in a Transaction object so that the rule is executed only if the end user performs an insertion.

Samples

Consider the following Transaction objects: 

Product
{
  ProductId*
  ProductDescription
  ProductStock
  ProductLastPurchasePrice //stores the price of the last completed order for ProductId
  ProductLastPurchaseDate  //stores the date of the last completed order for ProductId
}

Order
{ 
   OrderId*
   OrderDate
   ProductId
   ProductDescription        //inferred from the Extended Table
   ProductLastPurchasePrice  //inferred from the Extended Table
   ProductLastPurchaseDate   //inferred from the Extended Table
   OrderPrice
}

Rules defined within the Order Transaction: 

ProductLastPurchasePrice = OrderPrice if Insert;
ProductLastPurchaseDate  = OrderDate  if Insert;

These assignments imply an update of attributes belonging to the extended table of the current level.

Therefore, every time a new Order is inserted, the Product table is updated.

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

See Also

Update function
Delete function

    

Last update: June 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant