Insert an image into an entity over an association

0
I want to add an image into an entity over an association. I chose this specific database structure because I want to give(in my case) a product a unique image, and eventually provide the user with a reference selector where they can choose one of the products froms each category ie. soil or flowers.  I got this part down, but I'm unable to upload an image in my NewEdit page. The "Upload" button is greyed out and I have no idea what's causing this. Hope you guys can help me out. Images for clarification: database   NewEdit page        
asked
1 answers
5

The reason that the image upload button is greyed out is that you have not created a ProductImages record linked to your GardenSoil/Flowers.  Try adding an after create microflow on your soil and flowers entity to creatre a new ProductImages record and link it to the soil/flower record being created.  Also set the reference so that the image is deleted if the parent is deleted.

Edit: This is a simple After Create event microflow that is defined in your GardenSoil and Flowers entities on the events tab:

Simply create the Image record, then change the Soil object to set the Soil_Image association to the NewImage record.  The only potential issue here is that as you are dealing with 2 separate linked records, you need to make sure that when you save the Soil record, you also save the linked Image object - a custom save microflow should allow you to do this

answered