Hi all,
Could you give me the code for richtext validation (not Blank or has an attachment). I tried but not succeeded.
Please help
Thanks
Hi all,
Could you give me the code for richtext validation (not Blank or has an attachment). I tried but not succeeded.
Please help
Thanks
Subject: Richtext validation
Hi,
It will be much easier to help You if You provide some code which You try.
In @Formula or LotusScript?
If LS - did You try ValueLength property? Remember, document must be saved first.
Regards,
Konrad
Subject: RE: Richtext validation
Hi Konrad,
I am using the LS code. The code is executing on the querysave event. The validation is that the RTF should not be blank. It should have either text os some attachment.
Subject: RE: Richtext validation
Please show the code that you tried. Tell us what happened when you tried it.
-rich
Subject: RE: Richtext validation
The code is:
Function fndContent(uidoc As NotesUIDocument, rtn As NotesRichTextNavigator, fld As String) As Integer
fndContent = False
If (rtn.FindFirstElement(RTELEM_TYPE_DOCLINK) Or _
rtn.FindFirstElement(RTELEM_TYPE_FILEATTACHMENT) Or _
rtn.FindFirstElement(RTELEM_TYPE_OLE)) Or _
rtn.FindFirstElement(RTELEM_TYPE_SECTION) Or _
rtn.FindFirstElement(RTELEM_TYPE_TABLE) Or _
rtn.FindFirstElement(RTELEM_TYPE_TABLECELL) Or _
rtn.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH) Or _
rtn.FindFirstElement(RTELEM_TYPE_TEXTRUN) Then
fndContent = True
Else
If uidoc.FieldGetText(fld)<>"" Then
fndContent = True
End If
End If
End Function
This code was not running correctly.
Subject: RE: Richtext validation
Under what circumstances does it fail? I notice that you are using both front-end and back-end methods. Are you aware of the issues related to synchronization of rich text fields between front and back end classes? Are you doing anything to deal with this?
-rich
Subject: Richtext validation
Why not do it with @ functions? They are quicker after all:
Something along the lines of @If(@Text(RTF) = ββ or @Attachments = 0; @Failure(βGitβ); @Success)