Hi,I have a Names field, it is ‘Use Address Dialogue on choices’, i
Default Value:@Name([CN];@UserName)
Input Translation:@Name([CN];@ThisValue)
Input Validation:Namet :=@IfError(@DbLookup(“Notes”:“NoCache”;“86256395:004EDFB0”;“($NamesFieldLookup)”;Name4;“FullName”);“Error”);
Name :=@Name([CN];Namet);
@If(Name4=“”;@Failure("Please enter a name for the " + Role4 + “.”);
@If(Namet=“Error”;@Failure("Please enter a valid name for the " + role4 + “.”);@Success))
OnChange event:
Sub Onchange(Source As Field)
Dim ws As New NotesUiWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
Dim Doc As NotesDocument
Set doc = uidoc.Document
Dim Eval As Variant
Dim session As New NotesSession
'string$ = notesName.Common
'doc.CNName4=Session.CreateName(Name4.Common)
Dim CNName4 As Variant
CNName4=Evaluate(|@Name([CN];Name4)|,doc)
doc.CNName4=CNName4
Eval=Evaluate(|@DbLookup("Notes":"Cache";"86256395:004EDFB0";"($Users)";CNName4;"PIN")|,doc)
If Eval(0) <>"" Then
Dim Evals As String
Evals = Cstr(Eval(0))
doc.tmpValue=Evals
Eval1=Evaluate(|@DbLookup("Notes":"Cache";"86256395:004EDFB0";"(PeopleByPin)"; tmpValue;9)|,doc)
ManagerKey = "UK" & Right(Cstr(Eval1(0)),6)
doc.tmpValue2=ManagerKey
ManagerName=Evaluate(|@Name([CN];@DbLookup("Notes":"Cache";"86256395:004EDFB0";"(PeopleByPin)";tmpValue2 ;6))|,doc)
ManagerNames = Cstr(ManagerName(0))
doc.Boss=ManagerNames
Call uidoc.Reload
'Call uidoc.FieldSetText("Boss",ManagerNames)
'Call uidoc.Refresh
doc.RemoveItem( "tmpValue" )
doc.RemoveItem("tmpValue2" )
doc.RemoveItem("CNName4")
'ManagerID :=
'ManagerKey := "UK" + @Right(ManagerID;6);
'ManagerName := (Cstr(Eval1(0));6);
'@If(@Name([CN];@UserName)="Andrew L Butler";"Andrew L Butler";ManagerName)
Else
Exit Sub
End If
End Sub
But…the onChange event only works when you exit the field or save the document - I want it to work right away.
I cannot change the field style to native OS.
Any ideas?
Thanks…