Link to home
Start Free TrialLog in
Avatar of ptenuta
ptenuta

asked on

show view columns

I have a form, with a keywords field. I´d like that when I choose an item of the field ("345", for example), a view appears in the form, showing only that documents in which the "code" column has the same value of the item I´ve chosen ("345").
I´m trying to do it with embedded views, but I don´t know if it´s possible, because it shows all the documents of the view.
How can I select the documents I want ??

Thanks !
Avatar of HemanthaKumar
HemanthaKumar

Could you please elaborate a bit, i.e. how ur passing the keyword field to viewbody.

Hemanth
Avatar of ptenuta

ASKER

Sorry , my English is as good as my Notes knowledgement ....

Actually I have a view which shows the documents included using form "A".
There is another form "B", which has the keywords field.

I want to choose an item of the keywords field, and show (inside form "B"), the documents of the view that has that item.

I´m not passing the keyword field to the viewbody. I just want to look in the view for documents that have a field that matches my keyword value. (And show them in my form).

Thanks!
Alright Here is the logic,

Create an agent which collect all the documents that match the search criteria specified by the keyword field.

Then put all the collected documents in a folder called CustomFolder( Should be a personal on first use), which can be formatted as required. Open that folder.

PS: Clear all the documents from the folder before you populate the folder with the documents.

Hemanth
Hi,

The criteria for ur result is:
the item which u search is the first colum in the view and is sorted.

After that put one computed for display field in ur form, write following formula as per ur field name:

temp:=@DbLookup("";Server:Database;View;item;column);
temp1:=@If(@IsError(temp);"";temp);
@If(temp1="";"[<i>]Not available.[</i>]";@Implode(temp1;@NewLine)).

When u select the item, i.e "345" and press Refresh button which has formula @Command([ViewRefreshFields]). the page is refreshed and u will get all the documents as per ur selected item.

If u don't get my answer properly then there is another way also, just go thru the design of the Disscussion database, they have the same logic.

Now u want to display view, ok so u have to put no. of Computed for Display field as much column u want to display, the formula will remain almost same without the "column" part.

in ur case the first column formula is:temp:=@DbLookup("";Server:Database;View;"345";1);
temp1:=@If(@IsError(temp);"";temp);
@If(temp1="";"[<i>]Not available.[</i>]";@Implode(temp1;@NewLine)).

TIA
-Niraj.
Avatar of ptenuta

ASKER

Niraj, I´ve tried to implement your answer, but I just get a "Not available" message .
It seems dblookup is not working ...
Here is my code :
temp := @DbLookup("";milos:supvir.nsf;viewprodnome;"Frios";1);
temp1:=@If(@IsError(temp);"";temp);
@If(temp1="";"Not available";@Implode(temp1;@NewLine))

I´ve put the item I want to search in the first column of the view, and it´s sorted.
How can I debug/test dblookup ??
Avatar of ptenuta

ASKER

Niraj, it worked now.
But I´m afraid it´s not exactly what I want. I need for each row a checkbox, in order to make it possible to a user selects what he wants.
And then I need to store these selected rows somewhere.
Is it possible to implement with this solution you gave me ??

Thanks !
Avatar of ptenuta

ASKER

I don´t know Notes very well, so I found it difficult to implement. That´s why I chose the other way.
I don't suggest the the usage of @DbLookup for building up the list of document links on a form, because it may exceed 64K of size limit very easily.

So try to follow what I have proposed earlier. If u need more details on how to.?.let me know.

Hemanth
ASKER CERTIFIED SOLUTION
Avatar of johnkean
johnkean

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi ptenuta,
Your problem can be solved by choosing
Show single category as the event in embedded views(in Programmer's pane of  the form)
You can restrict an embedded view to a single category.
1.Choose "Show Single Category" as the event in the Programmer's pane.
2.Enter a formula to compute the category. (eg: @text(your keyword field name))

The formula can make use of information about the current user and information from the current document (the one embedding the view).
For the Show Single Category option to work, the embedded view must first have been categorized . Note that the category name will not appear in the embedded view.  For example,  if you check the Show Single Category box for a category named Kitchen,  the embedded view will not have a line named Kitchen. Instead, you will see under Kitchen documents such as Stove, Refrigerator, and so on.
You cannot use @Commands with Show Single Category.

If you need more info. Pl let me know
Thanks for elaborating on what I was suggesting.
It is upto ptenuta to accept my elaborated answer.
Hi ptenuta,

Sorry for not replying u from longtime, 'cause i forgot the question subject, don't u think that exeperts-exchange can provide add to favourite like of link so the search is shorten, hey it's just my idea, sounds it funny?

now here is your interested part:

You can generate CheckBox in view and access document with that checkbox.

1) Create a form with at least two fields. First field is
called Key. It is a compute when composed field with a
default value of @Text(@DocumentUniqueID). The second
field is called Title. It is the document title and should be defined
as an editable text field.
2) Create a view from which your web users will select the
documents created in step one. This view will have only one
column with the following formula:
"[<INPUT TYPE=checkbox NAME=\""+"Selections"+"\"
VALUE=\""+KEY+"\">"+TITLE+"<BR>]"
The KEY and TITLE field in this formula come from the form
created above. Make the view a "Treat View Content as HTML"
This attribute is found under the View beanie.
3) Create a form with a field called "selections".
This field should be an editable text field with the multi-values
option enabled. Hide the field from the web browser.

4) Create an embedded view in the form you created in (3).
Select the view you created in 2.
5) On your web site, add an action that will create a document
with the form created in (3).

Now each time a form with the embedded view is submitted,
the field "selections" will contain all document keys that the
user selected. It is now easy to write scripts or agents that
will act upon those documents.

TIA
-Niraj