1
votes

I have created Notes documents by script and I want them to appear in a view.

I have the following selection formula for the view:

SELECT Form="formA" & status="X" & keyField = ""

If I check the view the documents do not appear in them. If I check the documents with help of ScanEZ, DocumentViewer or the Document properties box the documents match the criteria:

  • they docs have these fields
  • these fields have the correct values

if I change the selection formula to:

SELECT Form="formA" & status="X" & keyField != "SOMESTUPIDVALUE"

the documents appear in the view.

Note these docs are created by JAVA code and never opened in a Notes client.

Anyone have an explanation for this behavior?

3
From the Document Properties Box on the keyField field, what are the values of Data Length and Field Flags? - shillem
How are you creating the keyField value? Are you using a replaceItemValue? Otherwise it's possible it's creating the field, but not populating the empty string you are looking for in your original view selection criteria. You might want to put in Char(32) (didn't check if that's the method for Java), but the ASCII character string for an empty space. - Brian M Moore
Maybe the UNK table needs to be updated to reflct the proper data type for keyField. You can use "Load Compact -C" for this. - Per Henrik Lausten
Remove the selection formula to troubleshoot - Thomas Adrian
@PatrickKwinten there you go. Data Length should be 0 bytes and not 1. Make sure to rewrite your doc.replaceItemValue line manually. It might well be that your empty "" seems empty but it’s not. If you initially copied something in there and then deleted it to be empty string, what you copied might have contained an invisible character that you didn’t not erase entirely - shillem

3 Answers

3
votes

Have you got summary tags on those fields? Set issummary on the note items

0
votes

A bit of a guess, but I think you'll find that your Java code is setting the value of keyField to a single space character (" ") instead of an empty string "". Try changing your selection formula to this:

SELECT Form="formA" & status="X" & @Trim(keyField) = ""

If that works, you can fix your Java code to eliminate the unwanted space between the quotes, and the selection formula will still work for both your existing documents and for documents created after the fix.

0
votes

Could be that the view setting "Show response documents in a hierarchy" is set and the document you are creating is a response document. If this setting is true, response docs would only appear if parent document is also part of the selection.

Solution would be to also show parent docs or remove the $REF fields.