Hi, In a microflow, I need to send emails with custom excel sheets attached to it. I have both the XLSReport and EmailTemplate modules installed. I know in the emailtemplate module you can create emailtemplates that have attachments, but as far as I know this will be a static attachment (i.e. always using the same attachment in each email). I need to add a different attachment to each email. More specifically, I need to attach an excel sheet to each email. Now the EmailTemplate uses an Attachment object for it's attachments, which is a specialization of FileDocument. The XLSReport module creates a CustomExcel object which is also specialization of FileDocument. Neither have any specific attributes. Is there a way I can convert the CustomExcel object to an Attachment object, being that they are both the same generalization without any special attributes?
I don’t think we need to convert the files.
In Sub_CreateAttachments microflow you just need to pass the XLSReport.CustomExcel that we get from generating excel as parameter as it already accepts list of file document objects.
You could try to make a microflow with two input parameters, both of FileDocument. The first is for CustomExcel the second for Attachment. In this microflow you can do the DuplicateFileDocument java action from the CommunityCommons module.
I agree with Thijs also look at file handling module from App sore which has lot of useful java actions to close document or copy content.