Forcing user to Enter a valid and correct format in QC

For HP Quality Center, it doesn’t give you much control for any input fields. I want to make sure when a developer change the bug status to fixed, he has to enter a build version. Not with any value of course, because I like it to describe what Release and Build – RxB0xx. So it would detect if the value is less than 5 digits, then it would clear the field and requires user to enter the correct value. Here’s the scripts for QC 9.2.

[Common Script]

Dim OldValue
executed = 0

Function ActionCanExecute(ActionName)
‘Use ActiveModule and ActiveDialogName to get
‘the current context.
On Error Resume Next

‘need to also check if we are creating a new defect or
‘scrolling through defect details using next or previous defect buttons
If ActionName = “actBugDetails” OR “actPrevDefect” OR “actNextDefect” OR “BugAddAction1” then
executed=1 ‘we are not in grid
End If

ActionCanExecute = DefaultRes
On Error GoTo 0
End Function

[Defects module script]

Sub Bug_FieldChange(FieldName)
On Error Resume Next

If Bug_Fields(“BG_STATUS”).Value = “Fixed” and _ ‘make sure if this field changed, then do following
Len(Bug_Fields(“BG_USER_09”).Value) = 4 then ‘field that you want QC to validate value
msgbox “You must enter the Release and Build number (format: RxB0xx). example: R2B019”

Bug_Fields.Field(FieldName).Value=OldValue ‘revert back to the old value in the grid
End If

On Error GoTo 0
End Sub


0 Replies to “Forcing user to Enter a valid and correct format in QC”

Bạn có còn thắc mắc gì nữa không?