Hi, I have a requirement to only allow changes to four user-defined fields if they are being entered for the first time. They can't be changed once they have a value unless the user is a certain type of user. I have tried various things, but below is the latest. I get the msg box every time even though the length is 0 in the field being changed (as on a new defect). I'd appreciate any suggestions.
Function Bug_FieldCanChange(FieldName, NewValue)
Bug_FieldCanChange = DefaultRes
On Error Resume Next
If (FieldName = "BG_USER_07" or FieldName = "BG_USER_08" or FieldName = "BG_USER_10" or Fieldname = "BG_USER_11") Then
If Not User.IsInGroup("DSTO_QC_Manager") then
If len(BugFields.Field(FieldName).Value)>0 then
MsgBox "Sorry, changes to deployment fields are not allowed. The value in Moved to Test is: <" & Bug_Fields.Field(FieldName).Value & "> The length is: " & len(Bug_Fields.Field(FieldName).Value)
Bug_FieldCanChange = False
Else
Bug_FieldCanChange = DefaultRes
End if
End If
End If
On Error GoTo 0
End Function