Workflow to check for Unique value in a User field

  • Questions
  • Workflow to check for Unique value in a User field
Question ID: 105939
1
0

We are currently using a user defined field in our requirements module that follows a specific naming convention for each project. We would like for each entry to be a unique value. How could I verify that each value is unique in workflow upon creation?

Marked as spam
Posted by (Questions: 122, Answers: 3)
Asked on February 13, 2015 4:32 pm
5 views
Answers (1)
1
Private answer

I believe the below example should get you going:

Function Req_FieldCanChange (FieldName, NewValue)
If FieldName = ''RQ_USER_03'' Then
If Req_Fields.Field(''RQ_USER_03'').Value = '''' Then
Dim ReqNum
ReqNum = NewValue

Set ReqFact = TDConnection.ReqFactory
Set ReqFilter = ReqFact.Filter
ReqFilter.Filter(''RQ_USER_03'') = ReqNum
Set ReqList = ReqFact.NewList(ReqFilter.Text)

If ReqList.Count > 0 Then
Req_FieldCanChange = False
MsgBox ''Req # already exists. Operation aborted.''
Else
Req_FieldCanChange = True
End If

Set ReqList = Nothing
Set ReqFilter = Nothing
Set ReqFact = Nothing
End If
End If
End Function

Marked as spam
Posted by (Questions: 3, Answers: 168)
Answered on February 13, 2015 4:38 pm