Share this page

# Example: Changing Field Properties when a Field Changes

This example demonstrates how you can change the properties of a field when a different field is changed.

In this example, if the status of the defect `(`BG_STATUS`)` is changed to `Closed`, the user must provide a value in the field Closed in Build (BG_CLOSING_VERSION).

Add the code to the `Bug_FieldChange` event procedure, to make the Closed in Build field a required field if the status is changed to `Closed`.

VBScript example (supported in Desktop Client only)

Copy code

    Sub Bug_FieldChange(FieldName)
            On Error Resume Next
            If FieldName= "BG_STATUS" then
                If Bug_Fields("BG_STATUS").value="Closed" then
                    Bug_Fields("BG_CLOSING_VERSION").IsRequired=True
                Else
                    Bug_Fields("BG_CLOSING_VERSION").IsRequired=False
                End If
            Else
                ' Enter your code here.
            End If
            PrintError "Bug_FieldChange"
            On Error GoTo 0
    End Sub

https://admhelp.microfocus.com Application Quality Management 8942
Tips to improve your search results... OpenText™ Application Quality Management Help Center OpenText™ Application Quality Management Help Center OpenText™ Application Quality Management Help 26.1 All View Local Help Center View Online Help Center Version: