Cannot delete Document ID (containing no document) - Please suggest a way to delete the documentID

Requirement:

We have n number of rows for a file upload column. The requirement is when I upload a file in any of the row, it should get copied to all the rows. and if I want to update any one document, I just delete and upload a new document to the particular row.

Issue:

On submitting the form, the updated (or replaced) document is alone saved in KC. For the documents in other rows, the uploaded documents are not getting saved to KC instead DocumentIDs alone get created. When I attempt to display all these documents in another form, I get an error message saying "The document doesnot exist or may be deleted"


Kindly suggest a way to delete documentID having no document associated with it.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    I'm a little unclear on what you're asking, but if it's anything like what it sounds like, it seems like you need to update all of the duplicate (outdated) document IDs with the new version when one is updated. I would suggest you initialize a PV with the ID of the original document, then use that to search any rows storing that document ID, and also update those with the new document ID.
  • +1
    Certified Senior Developer
    It looks like when you are storing it in the database, you may be storing empty documents. If you are using the write to datastore node in the process model, use an XOR gateway node to check if the document is null before reaching the write to datastore node. The condition should say

    /*if the pv attachments is null*/
    if(isnull(pv!Attachments),
    Go to the node that doesn't write to datastore,
    otherwise, go to the write to datastore node
    )