I want to make a button that triggers a script that 1) creates a new post and then 2) imports a file to a container in that post.
What I have is:
a) One table ("clients") with clients and a layout with a portal that lists files related to that client.
b) Another table with documents ("documents"), that is related to the "clients" and then shown in the portal of the layout of the "clients".
I want to have a button somewhere in the "clients"-layout where the portal is, where I with a single click can create a new post in "documents", that is related to "clients", and then open up the file browser of the OS, so that I can select the file that I want to import to the container in "documents".
I have tried differens ways, but there does not seem to be a fool proof way to do it that I know of. Please help me!
Happy new year
Jonas Möller Nielsen