Message in a form

I created one message in a form like this:

Form - OnCloseForm()

IF Comment = FALSE THEN
MESSAGE(Text005);

This is to force my user to fill one field X before close form.

With this CA/L, the message appears but the form close any way.

I would like message appear and the form stay until user fill that field. How can I do it?

hallo,

i think it would be better if you use the form OnCloseQuery Trigger, where you can force the closing process. It is running before the OnClose Trigger and there can be use you Error message if you want.

But consider, with the error message you are going to loose all the changes made already.

unless the situation means you can safely call a “commit” first…

t

Hi Luana,

As suggested by Assalai, put the test on OnQueryCloseForm. You will get the result that you expected.

I have to disagree with walter (but please correct me if I’m wrong anyway), putting an ERROR command in one of the field/procedure will not cancel out all other fields’ value which have been entered in the form. But it will of course rolled back any transaction before the ERROR command called within a procedure

Regards,

-TR-

Hy Asallai

Even if I implement your suggest, the form is close any, the record is saved but the form closes imediatly.

Form - OnQueryCloseForm() : Boolean
IF Comment = FALSE THEN
MESSAGE(Text005);

How can I avoid the fom to be closed?

Hi,

MESSAGE dost not interput the flow on Nav and an ERROR command gives the issue above. Try using the CONFIRM command.

Thanks, this was a good solution.

Regards

Thanks

This was a good solution

Regards