Check if button clicked after modify any field

Hi all,

I have to display error massage after leaving one of fields after updating (or in create) without clicking in button in the form .

Any idea ,please help .

Thanks in advance

What kind of message? Do you want it after an entry has been made or do you not want someone to TAB through the field & leave it blank?

If your concept is to validate (if this field contains wrong data) you can override write or validatewrite (depends on concept) method on form datasource. Error msg can be displayed through infolog (Info(“STRING”) / warning(“STRING”));

Thanks for your replies ,but what i want is when i modify one of field from 6 fields i can do anything if i don’t click in button that validate my adress , this button exist already i have just to check if is clicked after modifying any field if not simple massage is displayed .

I don’t know which methods i can use and how can i do it ?


Hi Bouchra,

I have now read your question and follow up post several times. But I still have no idea what you’re trying to do.

As I understand your question then you have a form (classic NAV) with 6 fields. If you modify any of these fields then you can (NOT?) do anything if you don’t click on a “Validate Address” button. And if the button is not clicked already, then you want a message to be displayed?

Yes ,exactly …

Ok, then I assume that clicking the “Validate Address” button also sets a “flag” or sets a variable so that you can see if the button was clicked already.

Then you can use the OnValidate trigger of each field like this:

IF NOT AddrValidated THEN MESSAGE(Text001);

Where AddrValidate is a variable or field of the type boolean and Text001 is a constant with the message. If you use ERROR instead of MESSAGE then the current transaction will be canceled and the data entered by the user removed.

Thank you Erik .

Your answer is very helpful even if i use Dynamics ax 2009 because the idea is the same ,i added field in table which i changed the value when clicked to no and if i modify any field to yes then i test on this field in two methods modifiedField and validateWrite .

Thank you all

You have posted your question in wrong forum i.e., in Dynamics NAV forum.

The above given suggestions are for NAV and not for AX.

Oh you question was about AX! [:)]

Then that’s most likely why we couldn’t understand what you wanted to do! [;)]

I’m happy that I were still able to help you, but next time please post in the AX forums.