Ask the Expert

Checking for user entries in a rich text field

I have a rich text field where I'd like to make sure the user enters SOMETHING - ie text, an attachment, a picture - basically anything.

I know I can check Source.FieldGetText("FieldName") in the querySave of the form to check if there's text - and there are ways to check for attachments as well - but what if there's no text, and no attachment - what if there's only a picture (created with Create-Picture)? Any way to check for that?
You can check for it using the -EmbeddedObjects- Property in -NotesRichTextItem-. This property will return any embedded objects in the -NotesRichTextItem- you specify as an array. you can then check subordinate properties of those items individually if you need to by using -GetEmbeddedObject- and assigning the return to a -NotesEmbeddedObject- Object. Hope this helps.

By the way, this method also finds file attachments, so you could do a quick check for everything you need by verifying that RTItem.EmbeddedObjects does NOT return a null array AND RTItem.GetFormattedText is NOT the null string. These two lines would I believe satisfy your validation.

This was first published in February 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: