Mandatory filed with LS

I have form with fields that I want to make mandatory (required), so I want to prevent users to save document until they enter values in all files that is mandatory (fields are text and number type).I believe that I could define every filed as computed and put some LS, something like

@If(@IsDocBeingSaved & FieldName = “”;@Failure(“FieldName is a required field”);@Success)

I need correct LS code…

thx

Subject: mandatory filed with LS

Make field as editable and write the same formuls in Input Validation of the field or

In query save event of the form write script.

if source.fieldgettext(fieldname)=“” then

msgbox “Please enter value”

continue=false

end if

Subject: mandatory filed with LS

U can leave the fields editable and write the code in QuerySave event of the form

set doc = source.currentdocument

if doc.fieldname(0)=“” then

msgbox “…”

continue = false << this is important it stops save

end if

etc.

there are good examples in the Notes Designer HELP. READ

Subject: mandatory filed with LS

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Dim checkField (1 To 6) As String

' List of fields to validate

checkField(1) = "Color"

checkField(2) = "Size"

checkField(3) = "Pattern"

checkField(4) = "Style"

checkField(5) = ""

checkField(6) = ""



Forall f In checkField

	If f = "" Then Goto skipfield

	If Source.FieldGetText(f) = "" Then

		Msgbox "Field " & f & " cannot be blank", 48, "Validation error ..."

		Call source.GotoField(f)

Continue = False

		Exit Sub

	End If

skipfield:

End Forall

End Sub