genexus

Customize "foreign key not found" error messages in Genexus


I have a transaction with an offer to send to a customer. In the offer there is an attribute that is a foreign key towards the customer. However, if I don't enter the customer, I get this error message that shows the name of the attribute (OTESCLI) instead of its description (Cliente, Customer)

Error message showing 'OTESCLI' not found

. .

I assume that the error message is composed according to this label in the dictionary

Label with "%1 not found"

But I can't find any field in which I can indicate what to pass as a parameter to that label. I assume it is in the name of the attribute, I would like to insert the description. I could change the label text to a more generic "Required field", with no parameter, but I would prefer there to be a way to indicate which error message to show.

If I enter an additional error message

Error('Customer Required') if OTESCLI.IsEmpty();

this is ignored, the missing foreign key message takes precedence

How can I customize that error message in reference to the parameter to send to it?


Solution

  • You need to use the RefMsg() rule:

    Refmsg('Customer Required, please.', OTESCLI);