New Response

« Return to the main article

You are replying to:

    • avatar
    • Robert Garand
    • Posted on Fri 28 Jun 2002

    When using a $$ViewTemplate, DO NOT place a Notes 'Query' field on the form (or subform if that is what you prefer to use).

    When performing the query, the query uses the Notes 'Query' field and not the HTML field you coded. Therefore the Query is "" and undefined.

    Other than that the code works great. (Thanks Jake!!)

    If you use '$$ViewTemplate for Viewname' you can replace 'All' with 'Viewname' if you only want to search the view that is currently displayed. (Unless you place the 'function doSearch' somewhere other than the subform (if that's what you use), you can't control which view is used for the query.)

    Change --> openDbRelativeURL("All?SearchView&Query=" + s.value);

    To --> openDbRelativeURL("{ViewName}?SearchView&Query=" + s.value);

    One problem I have run into: I have not found a way to capture the name of the view that $$ViewTemplateDefault is displaying when using an embedded view or $$ViewBody field. If I were able to capture that and assign a variable or populate a field, I could use that variable in the openDbRelativeURL command to only search the displayed view.

    If you've got an answer to capturing the view that $$ViewTemplateDefault is displaying, it would be appreciated.

Your Comments