LotusScript test champ obligatoires
Bonjour,
je souhaite faire un test sur les champs obligatoires dans le Querysave d'un sous masque.
Le soucis que j'ai eu c'est que après l'affichage du message pour la saisie du champ obligatoire il n'execute pas legotofield et passe au code suivant, c'est pour ça que j'ai ajouter un exit sub (je ne sais pas si c'est correcte)
Le 2eme soucis c'est le champ impact qui est une case à cocher et en fonction de la case coché un champ de saisie s'affiche et doit etre obligatoire.
Je ne sais pas comment intégrer ce test sur un champ liste. J'ai essayer d'utiliser Iselement(Impact("A")) = True
mais il m'affiche une erreur.
Ci dessous le code que j'utilise.
Merci d'avance
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim Impact As String
Impact = Source.FieldGetText("Impact")
'Test champs obligatoires
If ( Source.FieldGetText( "System" ) = "" ) Then
Messagebox( "Please enter the System." )
Call Source.GotoField( "System" )
Continue = False
Exit Sub
End If
If ( Source.FieldGetText( "Impact" ) = "" ) Then
Messagebox( "Please enter the Impact." )
Call Source.GotoField( "Impact" )
Continue = False
Exit Sub
End If
Select Case impact
Case "A"
If ( Source.FieldGetText( "champ1" ) = "" ) Then
Messagebox( "Please enter the champ1 text." )
Call Source.GotoField( "champ1" )
Continue = False
Exit Sub
End If
Case "B"
If ( Source.FieldGetText( "champ2" ) = "" ) Then
Messagebox( "Please enter the champ2 text." )
Call Source.GotoField( "champ2" )
Continue = False
Exit Sub
End If
End Select
End Sub
je souhaite faire un test sur les champs obligatoires dans le Querysave d'un sous masque.
Le soucis que j'ai eu c'est que après l'affichage du message pour la saisie du champ obligatoire il n'execute pas legotofield et passe au code suivant, c'est pour ça que j'ai ajouter un exit sub (je ne sais pas si c'est correcte)
Le 2eme soucis c'est le champ impact qui est une case à cocher et en fonction de la case coché un champ de saisie s'affiche et doit etre obligatoire.
Je ne sais pas comment intégrer ce test sur un champ liste. J'ai essayer d'utiliser Iselement(Impact("A")) = True
mais il m'affiche une erreur.
Ci dessous le code que j'utilise.
Merci d'avance
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim Impact As String
Impact = Source.FieldGetText("Impact")
'Test champs obligatoires
If ( Source.FieldGetText( "System" ) = "" ) Then
Messagebox( "Please enter the System." )
Call Source.GotoField( "System" )
Continue = False
Exit Sub
End If
If ( Source.FieldGetText( "Impact" ) = "" ) Then
Messagebox( "Please enter the Impact." )
Call Source.GotoField( "Impact" )
Continue = False
Exit Sub
End If
Select Case impact
Case "A"
If ( Source.FieldGetText( "champ1" ) = "" ) Then
Messagebox( "Please enter the champ1 text." )
Call Source.GotoField( "champ1" )
Continue = False
Exit Sub
End If
Case "B"
If ( Source.FieldGetText( "champ2" ) = "" ) Then
Messagebox( "Please enter the champ2 text." )
Call Source.GotoField( "champ2" )
Continue = False
Exit Sub
End If
End Select
End Sub