Link to home
Start Free TrialLog in
Avatar of mermaidink
mermaidink

asked on

Domino R5 view needs to have a url link (where user is not required to open notes document on web to dowload attached files)

I have a view for user who are considered external and in the view is a filename column.  I don't want to allow them to access the document to download the file.  I need to do a url in that column.  There may be multiple files attached in the document.  I have looked around for a solution.  

I saw this post : Title: file upload
asked by janelow on 02/27/2003 04:30AM EST  
This solution was worth  30 Points and received a grade of A  

I was not able to get that working.  I am using Domino R5 and on the web.  I did do a field in my form called "AttachedFiles" and in this field I put:

"File/" target="_blank" onclick="return openNew(this.href);">http://domino.intranet.ai/teams/matrixlib.nsf/AIChangeLog//frmAIChangeLog/$File/"+@AttachmentNames

I did not see the multiple attachments appear in the AttachedFiles field on my form.  I put it as a computed field. Then when I used the fieldname "AttachedFiles" in my view, I saw nothing.  

What am I doing wrong?  

I have also tried to do this solution:
http://www.martinscott.com/DesignLibrary.nsf/scategory/1B8A83310FF6151385256C08001DF299?opendocument

Avatar of mshogren
mshogren

Did you save those documents again after you added the computed field?  If not, and particularly if you don't want to do that you could just put that formula in the column rather than using the extra field.

Avatar of Sjef Bosman
As mshogren suggests, you have to do this in the column itself. Something like the following formula should work (thanks Zvonko!):

    "[" + @If(@Attachments;
            "<A REF=\"/"+ @WebDbName + "/AllDocs/" + @Text(@DocumentUniqueID) + "/$FILE/"+ @AttachmentNames+"\">"+@AttachmentNames + "</A>";
            "") + "]"

By the way, you cannot prevent this way that a Notes specialist opens the document. If you want to do that, you have to block the form from being displayed on the web or you add a form formula to the view.
Avatar of mermaidink

ASKER

Sjef, your link appears in my column.  I also did it another method:

"["+"<A REF=\"/"+"http://domino.intranet.bellnexxia.com/teams/matrixlib.nsf/AIChangeLog/AIChangeLog/"+"$FILE/"+@AttachmentNames+"\">"+@AttachmentNames + "</A>"+ "]"

But I have the same result for both:

The column gives me the two file names which was uploaded to a document.  I still don't get a hyperlink for the two files listed in the column.  

So are you saying there is not other possible way of having a hyperlink in this column that a user can click (and the hyperlink opens to dowload the file as opposed to the opening of the form?  I can't block the form from being displayed because the form is also used by users on the web.    You also mentioned a form formula in the view...what did you mean here?

Thanks,
Anna
Ah, could be, that's because of the multiple values. Only one pair of [...] is allowed.

Try this:

    urls:= @If(@Attachments;
            "<A REF=\"/"+ @WebDbName + "/AllDocs/" + @Text(@DocumentUniqueID) + "/$FILE/"+ @AttachmentNames+"\">"+@AttachmentNames + "</A>";
            "");
    "[" + @Implode(urls; "<br>") + "]"
In the view, you can specify a form formula. When Notes retrieves the form to display the document, the name resulting from that formula will override the formname in the field Form in the document. So you could have a very simple form saying: Forbidden! and use the name of that form in the view's form formula.
I'm not following what you are saying.  In my view I have the following selection formula:
SELECT (Form = "AIChangeLog")

Are you saying to create a field in my form called "Form Name" and then put the value "Forbidden!"? I'm not understanding.. This is domino R5.  I have used it for 4 years and done alot of things with R5 but I am stumped.
So do you put in the view formula?

"Forbidden!"

I have a formName field with default value ="Forbidden!" in the form.

Was that what you meant?
No, sorry. Open your view, click in the middle somewhere to display the view's properties in the Objects window (at the left of the formula window at the bottom). You'll see something like:

[]    Thingum (View)
    <> View Selection
    <> Form Formula
    <> Help Request
    <> ...

The Form Formula is the property I was referring to. The View Selection is the formula stuff with "SELECT Form=...", that's correct, and you can force any document in the view to be opened by a specific Form other than the form mentioned in the document itself.
I am not sure if it is working the right way.  I put "Forbidden!" in the Form Formula section and then I have my View Selection Formula as: SELECT (Form = "AIChangeLog")

I then tested to see what happens:  I went to the view on the web to test it and opened up a link in one of the view columns and then it opened up a My form named "Main Topic) and it had the two attached files in that document which has nothing to do with the original document where it was uploaded.  It's good in any case because I don't want the user to open up my real form and read the info.  How did that work?  I never put forbidden in any form as a nickname?

Is this working the way you were talking about?
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

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
Anyway, this has little to do with your original question, hasn't it? ;)
Without creating that form "Forbidden", it uses my default form "Main Topic" which came originally with the R5.  This is a great solution.  I don't mind at all.  Now I totally understand.  Thanks so much!!!
Thanks for the compliment :)