File upload field uploading document even on cancel scenario

Hi All,

We have a requirement to upload a document which creates a new version of the existing document upon click of 'Submit' button and do not create upon click of 'Cancel button' (both buttons will submit the form).

Currently, Submitting the form (either through submit/cancel buttons) is creating a new version even though I am saving null value to uploaded files input upon click of 'Cancel' button.

I could see the below in appian documentation.

  • When implementing form cancel behavior via a submission, remember that the uploaded files are moved to the target on submission. If this is undesirable in a cancel scenario, it should be deleted (if target is a folder) or reverted via a new version (if the target is a document) by the process after submission.

but how can we revert the document to the previous version? Is there any function to delete the current version of a document or get a particular version of a document?

(even the Create new version smart service is deprecated)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I agree with and i also accept that, there are some scenarios where you want to work with multiple versions of the document, so if that's deleted, may cause an issue.

    And as per my understanding, you are also having the similar kind of functionality, where the document will be uploaded as new version, so that you will have repository of each and every changes on a particular document.

    So the solution i feel is, you can create a table which will store document id's with some relation with user and document type, now while uploading the document, try uploading it as an another document instead of creating as an another version, and store this document id against the same user and document type where the version will be (totalCount of document where condition will be: uploaded by a user && type of document +1), so in this way, you will have multiple documents available with you and whenever you want, can fetch document Id of any version of this document.

    I understand that, if you point a document in fileUploadField, it will create a new version, but you may get an issue when you want to retrieve or delete a particular version of the document.

    I think, you should have these R&D, it may satisfy your requirement
Reply
  • 0
    Certified Lead Developer
    I agree with and i also accept that, there are some scenarios where you want to work with multiple versions of the document, so if that's deleted, may cause an issue.

    And as per my understanding, you are also having the similar kind of functionality, where the document will be uploaded as new version, so that you will have repository of each and every changes on a particular document.

    So the solution i feel is, you can create a table which will store document id's with some relation with user and document type, now while uploading the document, try uploading it as an another document instead of creating as an another version, and store this document id against the same user and document type where the version will be (totalCount of document where condition will be: uploaded by a user && type of document +1), so in this way, you will have multiple documents available with you and whenever you want, can fetch document Id of any version of this document.

    I understand that, if you point a document in fileUploadField, it will create a new version, but you may get an issue when you want to retrieve or delete a particular version of the document.

    I think, you should have these R&D, it may satisfy your requirement
Children
No Data