This topic is locked
[SOLVED]

Exit without saving if a condition is not met in a field value

5/6/2024 11:57:30 AM
PHPRunner General questions
A
alfonso authorDevClub member

In before record added I want to put a message and not save the record if the value of a field is "si" instead of "no" Similar to:
if ($values["nee"] !== "SI") {
// Enviar un mensaje indicando que el valor es diferente de "SI"
echo "El valor de nee no es 'SI'.";
}

I suppose this is how it shows a message, but I don't know how to exit without saving

C
Chris Whitehead 5/6/2024

Have you tried return false;

if ($values["nee"] !== "SI") {
// Enviar un mensaje indicando que el valor es diferente de "SI"
echo "El valor de nee no es 'SI'.";
return false;
}