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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
preeti_aAuthor Commented:
Thanks for ideas.
The point is yours.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.