Multiple Attachments, Multiple RTF

Discussion in 'Lotus Notes Programming' started by Chie, Nov 22, 2004.

  1. Chie

    Chie Guest

    Hiya all,

    I'm hoping for some help that can shed some lights to what I've been
    trying to achieve.

    I've a workflow application that initially runs on Client but now have
    to be ported to the web as well. (R5 and R6)

    I've multiple controlled access sections on the form which is only
    editable at certain stage of the workflow. (e.g., if now at approval
    stage, only approval section is editable). In each section, I've a RTF
    available to allow user to attach files.

    Since this is going to be used on the web, I use multiple File Upload
    Controls to allow user to upload more than 1 file. The problem I faced
    is that files uploaded do not appear in their own respective RTF.

    I know they're all stored under $FILE. So I tried to detach and
    reattach them to respective RTF. This works fine. However, if the
    workflow continues to the next user who attached some files, the
    previous set of files will appear in his RTF as well. So now I remove
    the attachment from $FILE after each successfully reattachment but it
    resulted in "Item Not Found" when I click on any of the attachments.
    Apparently it's trying to look into $FILE to retrieve the file which
    is already deleted away by my code.

    So what shall I do? Why is it that after I reattach the files, it's
    still referring to the one in $FILE? Isn't it supposed to be separate

    This is giving me so much headaches, I'm going mad. I've tried all
    methods that I can find on the web but I still can't solve my problem.
    Really hope some kind souls can help me out here...

    Thanks in advance,
    Chie, Nov 22, 2004
    1. Advertisements

  2. Chie

    Vlad Kozin Guest

    Hi Janice,
    I think that handling attachments from different workflow stages in the same
    notes document is programmatically difficult. From what I've seen in
    Domino.Doc (complete workflow system sold by Lotus/IBM) they create multiple
    documents (most likely response type documents) during the lifespan of the
    document. So when somebody "approves" the document, they physically create a
    response document and re-attach their "version" of the attachment. I would
    take that way instead of trying to update attachments in the same document
    and controlling all those multiple sections. The multiple document version
    also gives you the ability to see the entire history of modifications, and
    you have multiple "cutoff versions" of the same document.

    I can't answer your question- what's going on in your code. Bad thing - a
    new attachment, even if it replaces the existing one, is given a new hex ID.
    Good thing is that the hex id is not used by lotusscript, you usually call
    the attachment by name. If I were you I would check if the attachment name
    stays the same during all stages. I would also try to detach it precisely to
    the same folder on any machine, like c:\temp. What I think is happening-
    when the file is reattached back the file name or path changes, which can
    cause the error.

    Vlad Kozin, Nov 23, 2004
    1. Advertisements

  3. Chie

    Chie Guest

    Hi Vlad,

    Thanks so much for taking the effort to reply. :)

    I've never thought of the method that you mentioned regarding how
    Domino.Doc works. It would be interesting how they implement it.

    While waiting for some kind soul to help me with this, I managed to
    think of a way (might sound like a crappy solution to some people but
    it'll work for me, at least for the time being). I grab the filename
    from each of the File Upload Control using JavaScript and store it in
    another file. Thereafter, upon form submission, I simply write <a
    href> code into another field, to reference each of the files.
    Although I do not have the icon look, a link is better than nothing.

    Have a nice day ahead.

    Chie, Nov 25, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.