Q

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 last published in February 2001

Dig Deeper on Domino Resources - Part 3

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close