0

I'm relatively new to Salesforce development. I have a requirement to create custom fields on our custom object; some of these fields must be able to hold a file attachment (PDFs usually).

I cannot seem to find any way to add a field where the user can upload a single file. The closest I can get is adding the Files related list in the lighting app builder, but this feels more like a work-around as its essentially just a bucket to hold all the files.

I haven't messed much with Apex Code but I'm sure theres a way to do it via code, I just need some help to be pointed in the right direction since I'm a little confused on how apex classes interact with objects and store data.

Thanks!

1 Answer 1

2

There is no such thing as a 'file field' in Salesforce. Files cannot be part of a record on a custom object. They can only be 'related' to a record. This is what you see when you add the Files related list to the page layout.

Judging from your description, you need the ability to upload files of a certain predefined type to a custom object record. This is not a standard ability of salesforce. It can be built using apex/lightning but that is not a beginner's project.

Maybe you are better off with a 3rd party app from the AppExchange. E.g. https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3u00000MRhurEAD seems enable you to do what you need.

2
  • Appreciate the quick response! I'm not a beginner when it comes to coding, my proper title is Software Eng, but I am a beginner with salesforce. Is it still recommended not to try a custom solution here? Could you also point me in a direction in case I wanted to try building it on my own? I've tried to find good resources online to learn apex/lightning code, but I still dont understand how the code connects to salesforce itself and how it can be run through salesforce. Thanks! Commented Jul 29, 2022 at 16:06
  • If you want an introduction project to salesforce, then yes it's a good project to work on. If I would be the business owner, I'd certainly also consider buying an app instead of building it. In case you want to get started building, Trailhead is the place to go. I'd recommend these modules for Apex and Lightning Web Components respectively: trailhead.salesforce.com/content/learn/modules/apex_database and trailhead.salesforce.com/en/content/learn/modules/… Commented Aug 1, 2022 at 7:25

You must log in to answer this question.

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