• Duplicate docs get saved

    By Michael Bryant 7 years ago

    I've got this implemented but, anytime I save/submit a new doc, I get two. One with the attachments and all data I selected/filled-in on the new doc and another doc that seems to be empty except for the default field values for some fields. This happens on new docs only.

    Any help is greatly appreciated!

    • Check moveUploadedFiles()

      By Mark Leusink 7 years ago



      For some background, here's what's happening:

      • user selects one or more files to be uploaded to the form.
      • when the form (on an XPage) is submitted, the files are uploaded first and attached to a (1) temporary document.
      • after all uploads have been completed, the form is submitted.
      • in the postSaveDocument event of the form, a call is made to the moveUploadedFiles function that moves the files from the temporary document to the correct target document.
      • the document containing the temporary files is removed.


      I'm guessing that the problem you're having is in the moveUploadedFiles() function, so I would suggest to debug it.



      • Thanks Mark

        By Michael Bryant 7 years ago

        I did some debugging and everything seemed to be working. I rebuilt the forms and got rid of the dups. Turns out I had an extra data source and that was causing issues. Strangely enough, now it's working perfectly on IE (8) and Chrome but can't get it to work in FF or XPiNC. The clinet really isn't a worry but I do want to find a working method for Firefox. That seems to be the default in the office, at least for those that would use this utility. I'll keep hammering away until I get it solved :-)

        • FF

          By Mark Leusink 7 years ago

          Glad to year you got it working. I actually built the component using FF (at that time) as my preferred browser. Might be that one of the new versions of FF or Flash broke it.

          • By Andreas Krassmann 5 years ago

            Hi Mark,

            I also have problems with FireFox. If I use Chrome or IE it works fine. Do you know whats the problem or how it can be fixed ? Im getting an IO Server Error on FF.

            • By Mark Leusink 5 years ago

              Hi Andreas,

              Sorry, but I have no idea. Like I said: it's probably caused by a Firefox or Flash update.

              I'm not actively maintaining this project anymore, since I think there are better alternatives to Flash available (that also work on mobile devices). Have a look at a HTML5 based uploader like dropzonejs.com or https://github.com/blueimp/jQuery-File-Upload

              Integration of Dropzone with Dropbox isn't very complicated: http://linqed.eu/2015/11/28/dropzone-js-in-xpages-it-doesnt-get-easier-than-this/ and

    • By Daniel Montes 6 years ago

      Hello Michael,
      I ' ve got the same problem, each time I save/submit I've got a conflict document.

      My xpage has only one data source and the button I press only do save task..
      please, Can you tell me how do you rebuilt the forms?

      • By Daniel Montes 6 years ago

        or Mark if you can point me to how I can debug moveUploadedFiles() function?
        but I think your code is ok…