Register Login

How to make a field Required Field.

Updated May 18, 2018

Hi Everyone,

I am declaring a GUIXT field and want it to be a required field. My coding is as follows :


inputfield (2,0) "Plant" (2,17) name="z_mm02_plnt" size="4" techname="RMMG1-WERKS" -required

When I see it on the screen the field does have a tick mark indicating that its a required field but does not give any error even if we leave it blank and proceed with the transaction. Do we need to do anything more to make that field required than my above code block?



Thanks
 


Comments

  • 25 Oct 2010 8:59 am rekha
    Yes you need to do something.
    For example :

    in the script of the screen :
    on "/11" Fcode="enter" process="check_required. txt"

    ("/11" means "save")

    inputscript "check_required. txt" :
    Screen XXXX
    if not V[z_mm02_plnt]
    Enter
    Leave
    Message "E: Field Plant is required" -statusline
    else
    Enter "/11"
    endif
  • 28 Dec 2010 11:24 am rekha
    setting an input field as required only shows the tick mark, or
    check. You must still add script to force the user to enter a
    value. Here's an example I added to my "Save" script:

    / make sure users have entered the required values

    If not V[z_short_descripti on] or not (V[z_fl] or V[z_equipment] )
    message "Please enter required data."
    return
    endif

    Regards,

×