QUESTION POSED ON: 12 August 2005
Brad, I am an old Lotus Notes developer (hacker) and I have created a few databases over the years. However I have not learned LotusScript yet, and I think I need to use it for this problem.
I have a form with a field named ALLOY. I need to validate this field using the logic below, if it's empty complain, and if the drop down box in said field ends up selecting NOT LISTED, also complain. Now, the command below works fine. . .
@If(@Length(ALLOY) <1;"MISSING BASE ALLOY";
ALLOY= "NOT LISTED";
"MUST SEE MARY LOU FOR THIS QUOTE";
@Success)
. . .but not when you click out of the field -- it only validates when you save the document. I need it to validate once you click out of the field. I thought a uidoc.refresh would do the trick (my only LotusScript knowledge) on the exit event --and it did -- but unfortunately I have several other fields on this form that also need to be validated, and once you click out of the ALLOY field and the refresh happens it complains about ALL the other empty fields on the form. So I was told I needed to take this command and put it in the exit event of the ALLOY field using LotusScript. I was also told that the syntax would look something like this:
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
if (uidoc.fieldgettext <1 then
Messagebox( uidoc.FieldGetText
( "MISSING BASE ALLOY" ) )else if
(uidoc.fieldgettext =NOT LISTED
then Messagebox( uidoc.FieldGetText
( "MUST SEE MARY LOU FOR THIS QUOTE" ) )
goto uidoc.field (ALLOY)
However as you can see I have totally messed this up and it doesn't work. Based on what I am trying to do -- validate several fields on a form at the point when you exit (exit event of each field) said field -- what should my LotusScript look like?
|