attached file to record using bean

Hi, Any help or documentation on how to add a documentent to a record using a bean?

I have a custom entry point that creates pdfs (inovices) on to the server, I would like to attach these to the corrisponding accounts.


First you can read these to understand the underlying implementation:

But you might prefer a simpler record type, like Notes:

For your code, you just create (for example) the Note bean, with the original file name saved in a field, and then copy the file into the “upload” folder, with the bean’s id as the new name.