Disable SAVE operation on field event

SUGGESTED

Hi.

I want to activate a control on a field, during the "AFTER FIELD" event: if user insert a not valid character into the field, when user leave from this field, the program has to show a message and disable the save operation (not only the button, but the entire save operation).

Is it possible something like this?

Thanks

Regards.

MS

  • 0
    SUGGESTED

    if you want to control a valid value on a field, the AFTER FIELD is not the best strategy to use.

    I suggest you add a CONTROL Field Action on that field, then check the value, and use mkstat to signal that the value is not correct. you may read code at any SUB*.* to get examples of this, you may have a look at Subprog C_SHIDAT from SUBSOH.src 

    • Control: (C_XXX)

    Called after the field has been modified, before the focus exits the field. This is used to control the new value. The new value is stored in variable VALEUR. The previous value is stored in the [M] class.

    This will set the user trapped on that field as long as its not a valid field, so he will not be able to save

    If your screen is a Object Management screen, and your function is GESXXX where XXX is your object, then If you want to rather allow the user to enter data and when he presses SAVE make a general control over several fields combined, then you must use the Object ACTION VERIF_CRE and VERIF_MOD where you can stop the saving by setting OK=0

    Regards