0

I have a custom object that gets created via a Flow, in that Custom Object I have a 'Type' and if Type is "A" then it allows users to UploadFiles, these files then end up in Related Files.

I need to grab this file and put it into an email to do that I first need to have a Unified Name for that File so I can Query and grab it, in order for that to happen I need to be able to change the file name to 'Error Wow ' or anything so when I am doing an Email send process I can Query [SELCT File from Attachments where Name = 'Error WOW'] or something like that.

Is there a way of doing this, I been reading all over I found a great code in this post but it didn't work it kept on giving me errors.

Please let me know what else I can do or if there is another way of sending an Email from Apex and grab every attached file related to that record without having to know the name of the file.

Thanks in Advance!

1 Answer 1

1

Uploaded files go into the ContentVersion object. (isn't that obvious! just kidding). They are connected to an object via the ContentVersionLink object.

The ContentVersion has an attribute called Title, and that should be where you can update the filename. https://developer.salesforce.com/docs/atlas.en-us.230.0.object_reference.meta/object_reference/sforce_api_objects_contentversion.htm

Not the answer you're looking for? Browse other questions tagged .