On lightning, I changed the File Settings and checked on this feature:
“Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments”
In my code, I have written a Javascript remote action that creates a case, inserts it, then it creates an attachment (with the above case's Id as parent id) and inserts it.
The issue is that I open the newly created case and there is no file there, only an attachment.
What am I missing?
N.B. assuming this cannot be achieved using the above settings, can I create a trigger to do the same?