SAGE X3 SCRIPT EDITOR - CONDITIONAL MANDATORY FIELD

SUGGESTED

Good day all. 

I want to write a small specific with an action on a field.

If Field A = 'condition' then Field B = Mandatory user input. Mandatory user input, users cannot move away from the field until they enter the data.

What is the command in script editor to achieve a conditionally mandatory field?

Parents
  • 0
    SUGGESTED

    Add a control/spe action to field_b and validate, that would add the "c_" subprogram section in the spe program. Then a you'll modify the c_ subprogram as below , change XXX with your screen name, change "ABC" with your condition

    Subprog C_FIELD_B(VALEUR)
    Variable Char VALEUR()

    If VALEUR = "" and [M:XXX]FIELD_A= "ABC" Then
        GMESSAGE = "This field cannot be blank"
        mkstat=2
    Endif

    End

Reply
  • 0
    SUGGESTED

    Add a control/spe action to field_b and validate, that would add the "c_" subprogram section in the spe program. Then a you'll modify the c_ subprogram as below , change XXX with your screen name, change "ABC" with your condition

    Subprog C_FIELD_B(VALEUR)
    Variable Char VALEUR()

    If VALEUR = "" and [M:XXX]FIELD_A= "ABC" Then
        GMESSAGE = "This field cannot be blank"
        mkstat=2
    Endif

    End

Children