locked
Workitems: Field Logic - validation and mandatory fields RRS feed

  • Question

  • I need to manage drop downs :

     

    Dropdown A selection 1

    defines that

    Dropdown B selections 1,4, 6 and 7 are valid entries.

     

    Question 1

    How do I manage the validation of input?

     

    Or better yet. How do I prevent faulty input in the first place (by only displaying the valid entries)?

     

    Question 2

    Can I change the behaviour of fields:

     

    Only if field A has a value field B must also have a value

    Tuesday, July 3, 2007 10:56 AM

Answers

  • Or better yet. How do I prevent faulty input in the first place (by only displaying the valid entries)?

     

    You could try to use the <WHEN> element inside your field definition.

     

    <FIELD refname="MyCorp.ProblemType" name="Problem Type" type="String">
        <WHEN field="MyCorp.ProblemCharacteristic" value="Documentation">
            <ALLOWEDVALUES>
                <LISTITEM value="Spelling Error" />
                <LISTITEM value="Bad Format" />
                <LISTITEM value="Missing Info" />
            </ALLOWEDVALUES>
        </WHEN>
    </FIELD>

     

    Only if field A has a value field B must also have a value

        <WHEN field="MyCorp.CustomerReported" value="true">
            <REQUIRED />
        </WHEN>

    Here is a link to where those examples come from

    http://msdn2.microsoft.com/en-us/library/ms194966(VS.80).aspx

     

    -paul

    Tuesday, July 3, 2007 11:10 AM