July 9, 200817 yr Newbies Hi All, I'm new to using FileMaker and am having an issue with a script I'm trying to write. Basically I've created a many to many relationship using an intermediary table because I need to store some information on the link. The association is between "Shops" and "Parks", with things like the distance between the two stored within the intermediary table. I was hoping to be able to add a button on the "Shops" page that said something like "Associate with Park". When the button is clicked the "Shop ID" is copied, and the user is taken to a new layout when the "Shop ID" is pasted into the foreign key field there. For some reason this doesn't seem to work, as when I create a new record on the intermediary table the contents of the copy is lost. (I think this is what's happening) Here is the script in pseudo-code: Copy [shop::Shop ID] Go To Layout [shop - Park Association] New Record/Request Paste [shop ID] Go To Field [Park ID] // so the user can now select the park Using FM7 on OSX. Any advice would be much appreciated. Cheers, Brenton
July 9, 200817 yr Copy and paste aren't the best tools to use. I'd recommend using global fields with Set Field[]s instead. You shouldn't be relying on Filemaker's Clipboard if you can help it. The issue may be with how you're using those functions, so simply adopting that good filemaker practice may solve your issue.
July 9, 200817 yr The Copy and Paste script steps only work when the fields are on the current layout when they are called. Make sure the ShopID field is on the Shop - Park Association layout.
July 9, 200817 yr Author Newbies OK, so I've got it working by creating a new table "Temporary" with the global field "Shop ID". I just set that field, then set the Shop ID on the other layout with that value. Is this the best/most correct way of doing this?
July 9, 200817 yr The global field could have been in any table, but that's good. OTOH, if you'd have been using FMP 8.5 or later you could have used a variable to hold the value and done without the global completely. IMHO it's worth the upgrade to 8.5 (or 9.0) just for variables.
July 9, 200817 yr Author Newbies I have to admit that I completely agree with you - this sort of application without being able to use something as simple as variables in scripts is a bit silly. Unfortunately the version of FileMaker being used isn't up to me :-(.
Create an account or sign in to comment