I have a card form in which some fields are compulsory, so I don't want to let the user close this form if he or she has not informed these fields. How can I do it?.
IF Condition THEN
BEGIN
IF (NOT CONFIRM("Continue anyway?, TRUE)) THEN
BEGIN
CurrForm.WrongField.ACTIVATE
EXIT(Steps);
END
ELSE
BEGIN
NEXT(Steps);
EXIT(Steps);
END;
END
ELSE
BEGIN
NEXT(Steps);
EXIT(Steps);
END;
We discusseed it a number of times. Shortly: set form to DelayedInsert. Put code into OnInsert. There are more sophisticated solutions based on this idea. Search for it.
Answers
If I also wanted to avoid the user not only closing the form but moving to another record in the form?. How could I do it?.
Thanks so much,
Try this in the OnNextRecord Trigger:
Un saludo,
-- Alejandro --