Replaces GeneXus default message whenever a referential integrity check fails.
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.
Objects: Transaction
This rule allows you to replace the GeneXus default message whenever a referential integrity check fails. There are two types of referential integrity messages:
- While inserting or updating: " No matching ......"
- When deleting: " Invalid deletion....."
However, only the first type of message will be changed by defining this rule.
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);
Note: 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.
Refcall rule
Prompt rule