QC – Requirement field allow only unique values
Tags:
Question ID: 104478
0
0

In requirement module one of the field should allow only R/A or SER-123 or SER-1234. (here nos 123 and 1234 will change for each time)It should not allow any other values.

Create a global variable to store the current value.

DIM g_save_value
=====================================================

Sub Req_New
….
g_save_value = ""
….
End Sub
=======================================================

Sub Req_MoveTo
….
g_save_value = Req_Fields.Field("RQ_USER_09")
….
End Sub
=======================================================
Function Req_FieldCanChange(FieldName, NewValue)
On Error Resume Next

Req_FieldCanChange = DefaultRes
If Req_Fields.Field("RQ_USER_09").IsModified then
NewValue = Req_Fields.Field("RQ_USER_09").Value
If PatternExists(NewValue,"DATA-[0-9][0-9][0-9]","False")= False then
If PatternExists(NewValue,"DATA-[0-9][0-9][0-9][0-9]","False") = False then
If PatternExists(NewValue,"N/A","False") = False then
msgbox " This field should allow R/A or SER-123 or SER-1234"
Req_Fields.Field("RQ_USER_09").Value = g_save_value
Req_FieldCanChange = False
End If
End If
End If
End If
On Error GoTo 0
End Function

I want to add the above function in only Req_FieldCanChange or I want to update in Req_CanPost etc. Please clarify.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on March 12, 2012 8:18 am
86 views
Answers (1)
0
Private answer

Hello EFX,
The Validation should occur in Req_FieldCanChange.

Marked as spam
Posted by (Questions: 1, Answers: 69)
Answered on May 11, 2012 9:44 am
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top