Search code examples
lotus-noteslotus-domino

Example of using @ViewTitle with NSFSearch?


I spent all of yesterday trying to make NSFSearch work with @ViewTitle, but I can't figure it out. The documentation has this to say:

ViewTitle - The address of a null-terminated string that contains a view name. If the selection formula specified by the 2nd argument (hFormula) contains the @ViewTitle function, then Domino or Notes uses the view name specified by this argument (ViewTitle) to resolve this @ViewTitle function.

If the selection formula specified by the 2nd argument (hFormula) does not contain the @ViewTitle function, or if you are not using a the selection formula (hFormula is NULLHANDLE), then set this argument (ViewTitle) to NULL.

But I can't find a single example of this anywhere and can't make it work with selection formulas like these:

@ViewTitle = "Test Folder" & @Created < @Date(2021;1;1)
@ViewTitle & @Created < @Date(2021;1;1)

An example or pointer in the right direction would be greatly appreciated.


Solution

  • I've never found a reason to use this, but I've always interpreted it to mean that you can compile a selection formula like "DocType = @ViewTitle". Then you can call NSFSearch three times, once using "Draft" as the second argument, once using "In Progress" as the second argument, and once using "Final" as the second argument. The compiled formula will run as DocType = "Draft" for the first call, DocType = "In Progress" for the second call, and docType = "Final" for the third call. You get back three results, as if you were searching three different views, but you only had to call one NSFFormulaCompile three NSFSearch calls