Related docs as typed attachments
Posted: 14 Aug 2017
Hello,
I have to give to users the possibility to store in SP some kind of requests. To the every request can be attached different files as attachments, but every attachment should have the property, that differs - what exactly it is (a.e. invoice, or list of participates or anything else - I've got the full list of attachments types). According to these properties the workflow in future will run.
I think this is the exact use case for related documents functionality. I think I can store the related document in the appropriate folder in the doc library. This folder could be named by guid that is generated when the new (parent) item form opens (and is stored in item`s folder). When the user drags-and-drop files to the control, client-side code checks weightier such folder exists and if not - creates it in doc library, and then moves the newly attached items to the folder. For a sure I could utilize the updateDroppedDocuments to set the attachments type (ask the user, as example, in dialogBox).
So on the view/edit form I can generate the appropriate caml query. The first my question is - am I able to change the "View" property of control dynamically?
Not everyone loves to drag-and-drop files, someone prefers to add files with the “Create new document” button. In this case, as far as I see, I cannot use the updateDroppedDocuments method. When user pushes this button the new dialog appears, and user have to choose the file (from computer) and the folder. After this, the form opens for additional files. So my question is: how can I customize these forms and pass there the field values from parent`s form?
Alternatively, I considered storing these files as exact attachments to parent item; and adding the text field to store full description in json format; and utilize knockout library to provide the ui/ux – but it will be more complex solution with poorer ui/ux, than native sharepoint could give.
So I need a piece of advice.
Thank you in advance!
I have to give to users the possibility to store in SP some kind of requests. To the every request can be attached different files as attachments, but every attachment should have the property, that differs - what exactly it is (a.e. invoice, or list of participates or anything else - I've got the full list of attachments types). According to these properties the workflow in future will run.
I think this is the exact use case for related documents functionality. I think I can store the related document in the appropriate folder in the doc library. This folder could be named by guid that is generated when the new (parent) item form opens (and is stored in item`s folder). When the user drags-and-drop files to the control, client-side code checks weightier such folder exists and if not - creates it in doc library, and then moves the newly attached items to the folder. For a sure I could utilize the updateDroppedDocuments to set the attachments type (ask the user, as example, in dialogBox).
So on the view/edit form I can generate the appropriate caml query. The first my question is - am I able to change the "View" property of control dynamically?
Not everyone loves to drag-and-drop files, someone prefers to add files with the “Create new document” button. In this case, as far as I see, I cannot use the updateDroppedDocuments method. When user pushes this button the new dialog appears, and user have to choose the file (from computer) and the folder. After this, the form opens for additional files. So my question is: how can I customize these forms and pass there the field values from parent`s form?
Alternatively, I considered storing these files as exact attachments to parent item; and adding the text field to store full description in json format; and utilize knockout library to provide the ui/ux – but it will be more complex solution with poorer ui/ux, than native sharepoint could give.
So I need a piece of advice.
Thank you in advance!