Official Content

Assigns a value to an attribute in insert mode, and works as a filter when using the navigation buttons.

Syntax

Equal(att , expression);

Where:

att
     Is the attribute to which a value will be assigned.

expression
     Is the expression that will be assigned to the attribute (att). It can be any variable, attribute or constant, and must be the same type as that given to the attribute (att).

Scope

Objects: Transaction

Description

This rule assigns an expression to an attribute in insert mode. For Update and Delete mode the rule will be generated as att = expression condition to filter records when using the navigation buttons or receiving the transaction primary key as parameter. The Equal rule first parameter (att) will be read-only in all Transaction modes.

Samples

Considering the following Invoice Transaction:

Structure:

Invoice
{
    InvoiceNumber*
    InvoiceDate
    InvoiceType
    InvoiceTotal
}

Rules:

Equal(InvoiceDate, Today());

InvoiceDate will be read-only in all transaction modes. The Equal rule will automatically assign the current date to the Invoice Date attribute when the Transaction is in Insert mode. When navigating transaction records using Navigation Buttons, only those records where "InvoiceDate = Today()" will be retrieved, skipping the records different than Today().

Notes:

  • When using the Update mode, the Equal rule is generated as a filter so it will never update the Equal rule first parameter (att).
  • If you try to access a record that does not match the filter (by manually entering the primary key), you will get a "Record not found" message.
  • The Prompt does not take Equal rule as a filter.

 







Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant