Hi,
I have a process that displays a form. The latter contains an upload component and a donwload link.
The upload mecanism works fine as I can see the "document_id" saved in my rule Input.
Could you tell me why when the user is in modification mode of the form (not readonly) the click on the download link throws this error please?
{"error":"APNX-1-0000-000","message":"Invalid Content ID","title":"An error has occured"}
If I save the form, leaving the process terminating, writing the data in DB, and then re-open the form (from the same process), the download button works fine.
When I am in modification of the form in the Designer, when testing the link, I can see the error is systematic, but if I launch a testing Expression rule to examine the document ID, I can verify that the document in file system Appian is fine :
todocument(51755) => gives me the correct document
Any idea ? maybe is it the normal way to work ?
Regards
Discussion posts and replies are publicly visible
Until the form is submitted, the document is in a temporary state. When your link points to this document, it will fail. This is default behavior.
Is there any way to know if this document to evaluate is temporary or not ?the function "todocument" returns the document as if the document was final.
Not that I am aware of. You would need to add some state handling to the form. By the way, why do you show a download link to a file I just uploaded?
Thank you Stefan... I just have to mask this download button in edit mode.
the form shows a grid of files, some files are old and has been uploaded for a while, so the user can still download them even in modification mode.
But anyway, I will mask definitely this link button in edit mode, it will be more simpler.
To be absolutely clear - It makes *no difference* that you're in edit mode. The only important consideration is that you *can't link to temporary files*, and this stays true whether you're viewing the interface editor or in a live task instance. You must only show links to files that have been moved into your normal Appian folder structure, and that only happens when the form the document was uploaded on is submitted.
Thank you Mike, I understand but it is misleading (for me).when the user has uploaded the file (in edit mode or not, and even with the Designer), a document Id is immediately generated, and the todocument returns this Id as if the document was final.
This is this last step wich is confuse for me...
All "toDocument()" does is take an integer number and cast it into the "Document Type" wrapper. It doesn't matter whether that ID actually represents a currently-accessible document, or any document for that matter. In other words it doesn't mean much.
ok Mike, thank you for this explanation.