Page 1 sur 1

champ texte riche obligatoire

MessagePublié: 03 Sep 2008 à 16:08
par khadija
bonjour

est ce que quelqu'un pour me donner une idée pour rendre un champ texte riche obligatoire

Merci beaucoup pour votre collaboration

MessagePublié: 03 Sep 2008 à 16:09
par Jérome Deniau
Voui

Créer un champ calculé de type texte avec formule: @text(nomduchampTR), ensuite dans validation d'entrée tester son contenu!

Uniquement Texte si pièce jointe, il faut tester @attachments......mais bon c'est rapide.....

l'affectation entemps réel du champ texte calculé

MessagePublié: 04 Sep 2008 à 10:36
par khadija
Jérôme Deniau a écrit:Voui

Créer un champ calculé de type texte avec formule: @text(nomduchampTR), ensuite dans validation d'entrée tester son contenu!

Uniquement Texte si pièce jointe, il faut tester @attachments......mais bon c'est rapide.....


le probleme c'est que l'affectation de la valeur du texte riche vers le champ texte calculé be passe qu'apres la sauvegarde du doc ;alors que moi je veux que la vérification passe avant la sauvegarde.

par contre j'ai essayé ça :
@If (@text(nomduchampTR)="";@Prompt([OK];"champ obligatoire";"Veuillez Mettre une description");@Command([FileSave]))

dans un botton "sauvegarder" , et vu que @text(nomduchampTR) ne se rempli qu'apres la sauvegarde donc le message "Veuillez Mettre une description" s'affiche toujours


Merci pour votre aide

MessagePublié: 04 Sep 2008 à 13:52
par Michael DELIQUE
salut

dans ce cas bonjour le lotus script

MessagePublié: 23 Sep 2008 à 15:55
par khadija
Michael DELIQUE a écrit:salut

dans ce cas bonjour le lotus script


salut

comment je peux récupérer le texte d'un champ texte rich

MessagePublié: 23 Sep 2008 à 15:57
par Michael DELIQUE
re,

regarde à notesItem.Text

MessagePublié: 04 Juil 2011 à 08:18
par Thelonious
Quelques éléments de réponse ici :
http://www.ibm.com/developerworks/lotus ... index.html

MessagePublié: 04 Juil 2011 à 09:12
par LSong
il faut penser aussi au uidoc.refresh (true)
pour forcer le richtext et aller le chercher en scripte

MessagePublié: 04 Juil 2011 à 13:07
par billbock
Code : Tout sélectionner
Function IsRTFNull(rtfield As String) As Integer
On Error Goto Errhandle
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
'Store the name of the field that currently has focus. Note: if this function is being called from a form button,
'currentfield will be null (because the button has the focus, and not a field). If this function is called
'from an action button, and if the cursor is in a field, then currentfield will correctly store the name
'of the field that has focus. currentfield = uidoc.CurrentField
Call uidoc.GotoField(rtfield)
Call uidoc.SelectAll
'The next line will generate a 4407 error message if the Rich Text Field is null
Call uidoc.DeselectAll
'Return the cursor the the field that had focus before this function ran. If the currentfield variable is null (because a button
'or hotspot had focus, then the cursor will actually wind up getting left in the rich text field.
If currentfield <> "" Then
Call uidoc.GotoField(currentfield)
End If
IsRTFNull = False
Exit Function
Errhandle:
Select Case Err
Case 4407
'the DeselectAll line generated an error message, indicating that the rich text field does not contain anything
If currentfield <> "" Then
Call uidoc.GotoField(currentfield)
End If
IsRTFNull = True
Exit Function
Case Else
'For any other error, force the same error to cause LotusScript to do the error handling
Error Err
End Select
End Function