broberts7usa Posted April 30, 2003 Posted April 30, 2003 I'm creating a large building (commercial real estate) database with 5 other related DBs (leasing, sales, available space, etc.). I knew I had to have a separate DB to hold all the building images (sometimes several per property) but I just couldn't wrap my brain around it - the learning curve is steep because I just started with FM, not enough time to learn, just plunged right in. All I could remember was having read: "relationships don't work with container fields ..." Then I read a post from Andy Gaunt and got it to work ... Phew! I still have a couple problems though, because each property can have more than one image, but only one displays on the main property layout (which doubles as a printed brochure). The photos are added on the property main layout and it creates a new record in the images DB - everything works just fine. The images are kept in a separate folder from the DBs and even the new record created in the images stores a reference to the file. But what if someone finds a better picture for the building (or an alternate view) and adds the new picture to the images folder (all the images are named with the property number ie. 1257im01, 1257im02 etc.) How to change the image on the layout without screwing up the images DB? When I change the image on the property record, to a second/alternate image for that building, it only changes the image record to match the second image, and the info on the "first" record (original version) is lost. I tried making the ImageID (file name eg. 2341im01) require strict validation for a unique name - that doesn't work. I may need a script? maybe? (an "add picture" button to idiot proof things) to look for the image in the images folder first before attaching it to the record, but then how to add an additional images record if you decide to change the picture to a different one (rather than changing the existing record and leaving the first image floating in the images folder without a record for it ...) And second question - if I do need a script, how would I go about this? Global fields are still not under my belt but I suspect I may have to stop and learn more about them... "if 1254im01 exists, then create a new record named 1254im02 (or the same name as the filename 1254im02.jpg, whatever ...) It's making my head spin, please help ... Thanks in advance ... Bonnie
Fenton Posted May 1, 2003 Posted May 1, 2003 I'm not quite sure what the exact problem is. One thing for certain is that a relationship matches the 1st record that matches (if the relationship is sorted, the 1st in that order). So, if you have a relationship to the Images database, based on property (or its ID), it's going to match the 1st image record that matches that property, in creation order. If you "physically" replace the actual image file of that first record, if the images were entered as a reference only, then the image in the database should show the new image (it does for me anyway). This is not done in FileMaker, this is done in the folder of images. The new image file has to be named exactly the same as the original. Which means the existing image file is either going to be overwritten. Or you can change its name first, or move it out of the folder. I'd recommend not having the image showing in the FileMaker database while you change the files; since it's going to have to redraw anyway. If you have thumbnails, inserted directly in container fields, you're just going to have to copy and paste them. Another more flexible possibility is to really add a number, similar to the file name serialization, to the Image database records. For example: PropertyID is "1254" ImageID is "1" Put them together with a text calculation, PropID|ImgID = PropertyID & " " & ImageID, 1254 1 Now, in the Properties file, build something similar; create a field for the ImageID. PropID|ImgID = PropertyID & " " & ImageID Put ImageID on the layout, as radio buttons, value list is "1, 2, 3, 4," etc. Create a relationship to the Image database: PropID|ImgID =::PropID|ImgID Now you can switch images, like a slide show, by clicking 1 or 2 or 3, etc.. There are more advanced lookup methods to get your ImageID's 1, 2, etc. automatically in Images. Not really beginners' stuff though. But for now, have ImageID auto-enter data, 1, in both files; to make the 1st image the default. And Replace a 1 into the field in all records, to get started. Ask for more help on that. It's simple, but a little dangerous. (Or use a Case statement to deal with empty numbers.) To get really wild and crazy you can use FileMaker 6 and AppleScript or a "file" plug-in to rename and delete the image files from within FileMaker. Also not for beginners.
broberts7usa Posted May 1, 2003 Author Posted May 1, 2003 The relationship works fine for One Building, One photo. And I understand about replacing the actual photo file in the images folder. What do you mean "I'd recommend not having the image showing in the FileMaker database while you change the files; since it's going to have to redraw anyway"? Is this a speed issue I should know about? When you talk about a calculated field for the image ID, you lost me. The images are already named, in the image folder, the naming protocol is "property number-im-image number" eg. "2457im01". I'd like to create some kind of script that looks for whether or not there is an existing photo before overwriting that one image record with the new (2nd or 3rd or 4th) photo, and which could create a new record in the event that a photo already existed named "2457im*.*". The value list idea is a keeper though because of the selection option. It would be perfect to be able to scroll through the selection of photos available for the property. Aren't we then talking about a global counter field (which I don't fully understand)to make this work? Replace a 1 into the field to get started? Case statement to deal with empty numbers? HELP ... I am using FM6, but this doesn't make me feel wild and crazy, only mildly dangerous because it's so "easy" I haven't done the homework like you guys have been doing. Afraid I'm hopelessly over my head ... Bonnie
kenneth2k1 Posted May 1, 2003 Posted May 1, 2003 Hi Bonnie: I just kinda skimmed your posts, so maybe I don't completely understand your problem. I am in the process of making a image db for insurance agents. My method is to not delete related images. I use a system of scripted buttons to add images/records. Since I am still working on it, I haven't built in a function to change a photo yet, but it wouldnt be that hard. I don't mind sharing if you think it might help. Just remember that it's not complete so don't expect too much. But it might give you an idea of what to do. It's too large to attach here, but if you want it, I can email it to you. You can email me at the address given in my profile. I was designed to run on Windows. Ken
kyle Posted May 1, 2003 Posted May 1, 2003 hi, ken ! your email address doesn't seem to be working. anyway, can i get one , too ? i need to work on image db in the near future and i like to get an idea. thanks, kyle
kenneth2k1 Posted May 1, 2003 Posted May 1, 2003 Youre right - forgot to change that a while ago. It should be working now. The package is 1.7MB, so I'm not sure if your AOL account will handle it. Let me know if it can, or if you have another email account that can handle large attachments. Ken
broberts7usa Posted May 1, 2003 Author Posted May 1, 2003 Hi Ken, thanks for your post and for helping out this newbie with a brain overload. I sent you an email and look forward to what you are willing to share ... I liked Fenton's idea about a button/slide show kind of thing ... any ideas? (I guess I'd better wrap my mind around the rest of it, first ...) Thanks again!
kenneth2k1 Posted May 1, 2003 Posted May 1, 2003 Hi again: Ok, this time I read all the posts thoroughly. A few thoughts... I agree with everything that Fenton suggested in the post - especially on how you should replace images in your image folder. But the whole PropID::ImageID relationship with radio buttons to scroll through records was hurting my fragile little mind also. I would have to try it to understand. To ID my records, I use a method that was posted here by CaptKurt a while back. I think this might mess with your whole naming convention for your image files. Scrolling through images assigned to a record is done in the Photos database. I also have a way of setting one photo as the "master photo" that appears in the main database. As Fenton also said, a file management plug-in might be worth looking in to. I have used the Troi File plug-in to do many file manipulations. You can get image file names, paths, show thumbnails of all images in a folder (which I think FM6 can do) and create/delete files. Unfortunately, I cannot add this functionality into solutions I am planning to sell as runtimes (like this one), because the developer license is $249 (Windows only) and I'm kinda ballin' on a budget right now. I will email you both back.
broberts7usa Posted May 2, 2003 Author Posted May 2, 2003 Ken, I got your file - thanks! Also, I agree with you about rethinking my record IDs (in any of my 6 databases, fortunately I am only building now and only have a few test records in each one, so the ID issue will be easy to address once I make a decision about it). I already have a "default photo" (Y/N) field in my photos database but I have not figured out how to script it yet on the related-record side (the property). Here's a real newbie question which I am almost embarrassed to ask: why can't I look at your scripts/fields/relationships in the file you sent? (that's how I'm learning on the fly) Is it bad form to ask for a password? If so, I apologize ... it's apparent that I still have some learning to do before I can wrap my brain around all these issues and get on with things ... Another embarrassing newbie inquiry: where can I find out about the plugin and how it works? Sounds like it might help, but I know (obviously) nothing about plugins (except that they exist and things they can do). Abashed at my ignorance, and with gratitude for all your help! - Bonnie
kenneth2k1 Posted May 2, 2003 Posted May 2, 2003 Hi Bonnie Hmm, you should be able to access the entire file. I have no passwords set. Are all the features you stated greyed out? The Troi file plugin can be found at www.troi.com . A plug in works by giving you external functions. When you use these external functions, it calls certain operations from the plug in. There are complete instructions given with the plug in. Troi also does a good job with giving simple examples in a sample file. There is a evaluation version you can get for free. Ken
broberts7usa Posted May 2, 2003 Author Posted May 2, 2003 Ken, The answer is/was yes, everything was greyed out. When I first opened the file your shortcut didn't work and I had to open everything manually, both files one at a time, which of course gave an error. I'm a newbie with FM so I assumed I either a) needed a password or : did something wrong. After I read that you had no password it was clear that I did something wrong (or my OS did). I went back and slowly and deliberately unzipped everything again and then the shortcut worked this time and now nothing is greyed out. I can only speculate about what Windows XP (or I) did the first time. I work at home on Thursdays and I tend to multitask like crazy staying in touch with work and "developing" (hah! "learning") at the same time, so I max out this 2-yr-old home machine... Your design is excellent. Your add photos button is a better solution (less brain cramp) than what I had been trying to do and it seems more user-friendly (when this finally gets done), so I will abandon the way I had been trying to solve it. I still want to try Fenton's radio button idea, sounds even more user-friendly for the assistants who are attaching photos to records, but my brain hurts from figuring out all this other stuff that has to happen first! I have not yet investigated the plugin but I can tell already that it will be worth it if I do not have to educate (future) users about "naming" conventions for image filenames they add to the images folder (they are assistants and their brokers list properties and they will be the ones coming up with the images). I am sure I will implement CaptKurt's numbering system for an invisible data record for each photo anyway to use behind the scenes. I can't get over how helpful you are (everyone on this forum too) - I am trying to learn FM on the fly and I have a LONG way to go before I can start providing help back : ... but I will eventually ... Thank you! OK onwards and upwards to study your file, I am sure I will be back with some more questions soon - THANK YOU - Bonnie
kenneth2k1 Posted May 2, 2003 Posted May 2, 2003 Hello again I am glad that you might find this helpful, and I can understand your concern about the file naming convention correlating with the name of the image embedded in FM. Most of the agents in my business have two items: 1. a Property inspection sheet 2. a Digital Camera (in some cases they scan exposures) The key is for them to fill out the inspection sheets in the same order as they take the pictures because the digital camera assigns a chronologically incremented number to the image. Then they go back and enter records in the same order they took the pictures. This process is the best I can come up with, since we are all human and it is difficult to place 100 different properties to 100 different people after-the-fact. Anyway, my beleif is that since we are all different, naming conventions will be different (and thus you would have to still educate your users on an universal naming convention for inital data entry). The one truth should be that the record in FM should correspond with the proper image. Yet, I highly recommend looking at the plugin because it does give you more ability. Ken
Recommended Posts
This topic is 7917 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