Posted: 17 Mar 2021 16:02 EDT Last activity: 17 Apr 2021 13:42 EDT
How to bring back the old attachment utility in Theme Cosmos
By default, the case page template in the Cosmos Theme provides the same attachment utility that was included in UI-Kit 12 and higher. This attachment utility is named 'Files and Documents. It lets you attach different types of content (rich text, local file and url)
When attaching a simple file (using the local file option), you need to provide a name for the attachment - a new document will be created and the file will be attached to the document. this utility allows previewing the attachment using the preview panel (if the file is of type pdf or an image) as well as to drill down into the document.
only one file can be attached at a time using the modal dialog - you need to open a new modal dialog for every file
each file is attached to a separate document - previewing the attachment will require drilling down into the document case type
it is not possible to select the category type of the attached file
This document describes how to use the old attachment utility widget that was provided in UI-Kit 11 or lower in Theme-Cosmos. The older attachment utility only supports local files and URLs - it is not possible to attach rich text content. the old utility does also not support preview or the preview panel - the only option available is to download the file
Clicking on the wheel button in the utility will bring an action menu that lets you add a file or a URL
The modal dialog will let you attach several files and pick the attachment category
The attached files will then display in the utlity
To bring back the old utility, you can copy the section pyCaseRelatedContent from the attached RAP into your application
***Edited by Moderator: Pooja Gadige to add Developer Knowledge Share tag***
@RichardMarsot - This is great! I haven't tried it out, but I will.
Can anyone answer why multiple files and Attachment Category options were removed? They seemed to be pretty fundamental and much-needed functionality. I am a Solutions Consultant, and these two capabilities come up a lot.
Also, why does App Studio allow me to define Attachment Categories if I can't even reference them from the OOTB attachment functionality? The only possible use of Attachment Categories in App Studio is the "Attachment" data type for fields, but such a field only allows a single file to be attached. So, how would I upload multiple files of the same category?
Who can explain the reasons for this, and whether there are ways to get that original functionality OOTB (i.e., without the workaround posted here)? It seems we must just be missing something, as surely that functionality wasn't just removed...?