[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Quesitons around searching a view

The database I'm support contains request from 2 different departments. We have multple views that show docs from both departments. I would like to add buttons to the top of the screen that filter the list by either department. Unfortunately, the form I am searching on does not include the department field, so I was thinking about using an ftsearch. But that's a collection method and I'm not sure how to refresh my views with the results of the search. Is that possible?

End result would work like this....I open a view that shows all dept's. I press a button that says dept A, and the view updates to show just dept A.

Thanks!
0
BillTr
Asked:
BillTr
3 Solutions
 
qwaleteeCommented:
Umm, you can't directly filter a view by full text search.  LotusScript gives you no access to the search interface. Any ftsearch you do only applies to the objects in the script. Bill (I think it was Hanson) has a bit of code posted recetly that uses SENDKEYS to conduct the search in the searchbar, as if the user had entered the search terms manually.

Also, you mean the form doesn't contain the field, or the document doesn't contain it? If the DOCUMENT doesn't conta it, you have no way to search. If the form doesn't contain it, but the document does, you can do a search, just not using the "Fill outr example form" dialog. Instead, you do the "Field..." search dialog ("by Field").

You can also use @SetViewFilter, if  the view categorizes on department. If not, you can switch to a view that does ctagorize on department and set the filter. It works a lot faster than ftsearch.
0
 
cezarFCommented:
0
 
Sjef BosmanGroupware ConsultantCommented:
How do you know that a document is from dept A? If you were to do a query like in SQL, what would it be?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
BillTrAuthor Commented:
Sorry for being so slow getting back. The form is used for requests to various systems. Different dept's
have different systems. So my query would be to select the systems for dept A.

I can  make this a field on the form too, update the existing forms, etc. But, if I do that,what I want to avoid is having more views...

I was wondering if I could select docs via the ftsearch, then somehow leverage the "ViewShowOnlySelected" function to filter the view?

It's possible to call a function from a script now, right?



0
 
Sjef BosmanGroupware ConsultantCommented:
You can do two consecutive searches if you want, the first one in the entire database, and the second one based on the results of the first request. I think you can also do an FTSearch on the selected documents in a view, using the UnprocessedDocuments property. But what you cannot do is JOIN-like searches, which means that all data you're searching for must be in the documents themselves.

By the way, whether a field is on a form or not is not relevant for searching the database. The field must be in the document, and since fields that do not appear on a form can still be in the document, you'd have to inspect the documents when you're searching to find out how to proceed exactly. But usually, form and document go hand in hand.

To show the documents found with an FTSearch, you can use a NotesNewsletter object. There are some examples in the Designer Help database.
0
 
qwaleteeCommented:
Yes, you can call a function from a script, but the one you want to use -- FTSearch -- does not do what you think it does. The documentation is a little confusing. You might think it filters down the view that the user sees.  It doesn't. It only filters down the way that particular script will access the view (an "in memory" filter). The user's view appearance never changes.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now