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`.

    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 ALM 8942
Tips to improve your search results... ALM Help Center ALM Help Center ALM Help 16.00-16.0.1 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: