Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Web Query?


1. I have an editable field in a "FORM A" where the user inputs the value e.g "TESTING" and clicks submit.
2. On this click I need to lookup this value "TESTING" in a view and search for this value and if this value exist "TESTING".(then i need to redirect that user to "abc" URL or if it doesnt exist then redirect to some other "xyz" url)
3. I have a view with documents from some other form "FORM B" with docid and the reqd field value sorted which stores this document for lookup.

But the problem is how to get this value "TESTING" from "FORM A" and search in the "FORM B" and redirect.
Any ideas / suggestion on this will be appreciated

  • 4
  • 2
  • 2
1 Solution
ZvonkoSystems architectCommented:
Is this for web user only and with Domino R5?

preeti_aAuthor Commented:
Yes it is for web user
Domino 6
ZvonkoSystems architectCommented:
Do you like to have this:

1.) You have a FormA showing an input Field. The value for this input field is your search value.
2.) You have a View with the first column sorted. You want to lookup whether the SearcValue is among the first columns of this searchable View.
3.) If the search value is found you like to show all documents from the view having this value.

If this is what you like to have, so tell me please whether this search value can be the complete Category of one of the categories in your searchable View.

Then you could use the R5 and R6 View feature: ShowSingleCategory

Tell me more details.
Independent Software Vendors: 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!

preeti_aAuthor Commented:
The First two points of urs are perfect(this is what i want)
But i dont want to display any documents instead
the view which is having this document needs to compare at background and redirect the user accordingly on a click.
Also this view is storing documents from other form so i need to check this input field value from "form A" with "form B" documents.

The problem is that this two forms is not related to each other.

PS : This was my thought when i came across with this problem.
Create a field , capture the input field value and keeping this as a keyfield do a lookup in that view and do a comparing : But here i came across with a problem again , firstly as how to capture the input value , do a lookup , search and compare it and do the process and redirect ? on just one click :-(

I am getting confused...plz give me ideas.

Create an agent and call it in your WebQuerySave event. In the agent, use something like this:

Set session = New NotesSession
Set doc = session.DocumentContext
Set db = session.CurrentDatabase
Set view = db.GetView("MyViewUsedForLookup")
Set LookupDoc = view.GetDocumentByKey(doc.EditableInputValue(0),True)

If LookupDoc Is Nothing Then
     Print "[xyz URL]"
     Print "[abc URL]"
End If

Make sure the Print "[URL]" is the last statement in the agent - this will cause the browser to be redirected to the [URL] that you have specified. Hope this helps.

preeti_aAuthor Commented:
Thanks Scott
Is there any other way,other than making use of an agent?

Reason : This nsf is residing on a server (site) which doesnt allow to create any agents :-(

You may have to make use of pass-thru HTML. Notes allows a special field called $$Return on a form that contains the content that the web user will see when they submit the form. You can create a formula value for this field and display different pass-thru HTML depending on whether the lookup document was found. Something like this:

begin := "<script language=JavaScript 1.2>";
temp := @DbLookup("":"NoCache"; ""; "MyLookupView"; EditableInputValue; 1);
middle := @If(@IsError(temp); "window.location='xyz URL'"; "window.location='abc URL'");
end := </script>
begin + middle + end

Hope this helps.

preeti_aAuthor Commented:
Thanks for ideas.
The point is yours.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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