Hey guys,
I am currently developing a customization where I need to attach files from the Invoices and Memos screen to the Email Activity screen. E.g from this screen:

to this screen:

I am currently implementing the following logic:


But it looks like the trace log below the assigning of the emailActivity retrieves a noteID of null although retrieving a file from the invoice:

Any help on this would be greatly appreciated!