Newbies kassandra Posted April 12, 2012 Newbies Posted April 12, 2012 Hi all I am new to Filemaker and I would be grateful for your help regarding a relational database I would like to build. I want to have one table with 10 fields, named 'objects', and to relate this table with another one that will have information on pictures related to the records of the table 'objects'. Each record in table 'objects' might have one or more pictures related to it. I would then like to have a different layout where I can see all the pictures that are available for object 1, etc. It seems easy to do, but I cannot find a way to do it properly... Any help would be appreciated! Many thanks
efen Posted April 12, 2012 Posted April 12, 2012 I'm not sure that the file attached to the thread below is exactly what you require but it could give you a start. http://fmforums.com/forum/topic/72455-script-in-portal/#358665
Newbies kassandra Posted April 13, 2012 Author Newbies Posted April 13, 2012 Thanks a lot! it seems to be working!
Newbies kassandra Posted April 16, 2012 Author Newbies Posted April 16, 2012 Hi all, I have two related tables: the first table, the "object" table is related to the "images" table via object_id. I want to be able to add new records in the "images" table for each object_id, automatically copying the object_id from the record I created in the 'object' table and enabling me to write new data into the other fields of the 'images' table. I tried doing it with set field but with no success. Many thanks in advance for your advice
Vaughan Posted April 16, 2012 Posted April 16, 2012 Use a portal, and set the relationship to allow the creation of related records.
Newbies kassandra Posted April 17, 2012 Author Newbies Posted April 17, 2012 thanks for the reply. this is not exactly what I would like to do. I would like the id field from the table 'objects' to be automatically copied when I create a new record in the 'images' table. So for example, I would like to create a record with a unique id in the table objects and then add images for this id in the table 'images'. How could I do that with a script?
efen Posted April 17, 2012 Posted April 17, 2012 I would like the id field from the table 'objects' to be automatically copied when I create a new record in the 'images' table. So for example, I would like to create a record with a unique id in the table objects and then add images for this id in the table 'images'. Not sure that I understand what you require ... This is done in the file already - you select a record in the portal and by clicking the blue button it allows you to select an image to insert in the image container, linked to that record. You can add a button to create new object records, from which to select to add an image, on the main layout in my file and they will appear in the portal. Or do you mean that you want to be on the image layout and create a new object record and then add [a] related image?
Newbies kassandra Posted April 17, 2012 Author Newbies Posted April 17, 2012 I am not very clear about it... In the "image" table, I have information on images (description, links to online webpages, etc), not an actual container with images. I want to be on the object layout and have a button there to take me to the image layout, where I can add the relevant information on the images related to the object-record from where I started on the object layout. Each record in the object table has a unique id, which I would like to automatically copy to the image layout whenever I press this button and create a new record in the image table. does this make sense?
efen Posted April 18, 2012 Posted April 18, 2012 I'm still not sure exactly what you need. Does the attached - just a bit more added to the file that was attached to the other post - help. It's a bit of a mess and could be significantly improved. I would have done all this differently/much simpler if I had realised (i.e. read your first post carefully) that you don't really require a related "image table" but a related "image information" table. InsertPics2.zip
Recommended Posts
This topic is 4671 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now