Refmsg Rule

Official Content
This documentation is valid for:

Replaces GeneXus default message whenever a certain referential integrity check fails.

Syntax

Refmsg('Character-expression' | &var | att , att1 , ... , attn );
 
Where:

    Character-expression (or &var or att )
         Is the phrase (string) you want to display when the referential integrity check fails.

     att1 , ... , attn
         Attributes that forms the foreign key (simple o compound by several attributes) for which the referential integrity check fails.
 

Note: There are two types of referential integrity messages:

  • While inserting or updating:  " No matching ......"
  • When deleting: " Invalid deletion....."

Only the first type of message will be changed by defining this rule.

Example

Given the following Transactions:

Airline
{
   AirlineId*
   AilineName
}

Flight
{
   FlightId*
   FlightDate
   FlightPrice
   AirlineId
   AilineName
}
The following rule is defined in the Flight Transaction:
Refmsg('Enter a valid Airline, please.', AirlineId);


Notes

Since GeneXus 16 upgrade 9 the Refmsg rule offers the following features:

  • You can include the Format function as the first argument containing any attribute that is present in the Transaction Structure in the message to be shown.
  • A warning spc0158 is displayed when a Refmsg rule will be never triggered.
  • A warning spc0231 is displayed to warn if the Refmsg rule references secondary attributes that cannot be instantiated.


Scope

Objects    Transaction object

 

See also

Refcall rule
Prompt rule