0
votes

I have some documents who have a field called From and some of them have RFC822 Internet mail text. Its contents are displayed the document properties something like this:

Field Name: From
Data Type: RFC822 Text
Data Length: XX bytes
Seq Num: 2
Dup Item ID: 0

Field Flags: SUMMARY NAMES 

RFC822 Type: ADDRESS
RFC822 Flags: STRICT 
Native Value: 

"ABC XYZ <ABCXYZ@PQR.COM>"

RFC822 Header Name: 

"From"

RFC822 Header Delimiter: 

": "

RFC822 Header Body: 

4E 79 6A 52 19 ABC 
6F 59 6F 60 32 XYZ
...
...

In LotusScript I was able to write the following piece of code to identify if the field has RFC822 Internet mail text.

Set item = doc.Getfirstitem("From")
If item.Type = 1282 Then
    'Field has RFC822 Internet mail text
End If

But how can I check this in Formula Language? I cannot find any equivalent Formula code that would check for RFC822 Internet mail text. I am trying to identify fields of type RFC822 TEXT with the field properties shown similar to above. I need this so that I can put it into view selection formula and see all the documents in a single view.

2
I'm a bit confused over what you really want. Are you trying to identifying fields of type "RFC822 TEXT" (as seen in the field list in the doc properties box)? Or are you trying to identify fields that contain a valid address that conforms to the RFC822 address spec? Or are you trying to identify fields that are of type RFC822 TEXT and contain a valid address that conforms to the RFC822 address spec? Or something else, if I missed any possibilities here ;-) - Richard Schwartz
I am trying to identify fields of type RFC822 TEXT with the field properties shown similar to my question. I need to somehow get all the documents with that kind of field value to be shown in a view. - Naveen

2 Answers

1
votes

I'm not aware of any way to check the field type in formula language. Can you write a LotusScript agent to check item.Type and add a hidden field (e.g., $HasRFC822TextItems = 1), and use that for your view selection formula?

If you can't or don't want to do that, another alternative is to create a folder, and use that instead of a view. I.e., have your agent test the item.Type as above, and then use NotesDocument.putInFolder("RFC 822 Text Documents").

0
votes

I think you can check if the item's value is in FRC822 format with this formula:

add := @ValidateInternetAddress([ADDRESS822];From) ;
x := @If( add = "" ; "RFC 822 ADDRESS" ; "OTHER ADDRESS FORMAT") ;
@Prompt([OK];"";x)

If the formula returns an empty string, the validation was successful or in other words: the value in the field From contains a valid RFC822 value.

It does not check the item's type though.