Check Duplicate EmployeeID field
I'm looking for a vbscript that checks if the value that will gonna be signed to an employeeID field already exists in the other users accounts.
I starting using this generic code for employeeID insertion:
dim oVar, oUsr, tmp, title, text1
set oVar = wscript.arguments
set oUsr = getobject(oVar(0))
title = "EmployeeID Insertion"
text1 = "Actual EmployeeID: " & oUsr.employeeID & vbcrlf & vbcrlf & "Insert or Update the EmployeeID:" & vbcrlf & vbcrlf & "(Ex: 75309889078)"
tmp = inputbox(text1,title)
if tmp <> "" then oUsr.put "employeeID",tmp
oUsr.setinfo
set oUsr = Nothing
wscript.quit
But now I have to tune the code with this condition: Don't exists two OR MORE users accounts with the same employeeID, and this field have to be 11 numeric characters.
<message edited by gilvicente.araujo on Tuesday, January 31, 2012 6:52 AM>