Newbies renny5 Posted December 30, 2002 Newbies Posted December 30, 2002 Hi folks, I'm hoping someone out there can help a newbie. I've tried to use a FM template to help a friend with her business. It's almost done except that I can't get this one button to work In case I don't describe it well, here's what the layout looks like: http://members.cox.net/renny55/invoice.jpg I have a layout with Contractor and Client info - name, address, etc. and I want to have two buttons that will pull their info into their corresponding fields. The template button works to pull in Client info (it opens the people database so you can pick the person and then you click "use" and it sends the info back to the invoice database) and I've tried to modify a copy to make it pull in Contractor info with no luck I did, however, figure out how to make the Contractor fields Lookups, so when you manually type in the Contractor ID# at the bottom, their info pops into the correct fields - Now I just need a button to do that because my friend will never remember everyone's ID#. If anyone can help, I'd be so thankful. ~Renee
mdpres Posted December 30, 2002 Posted December 30, 2002 Renee, I am not a big fan of copy/paste, but you could have a script that copies the ID# and then paste it so your lookup works, or if you have a relationship between the 2 files have your script set field ID#. Dean
Newbies renny5 Posted December 30, 2002 Author Newbies Posted December 30, 2002 thanks Dean, that gives me something to go on. This is the script that works: http://members.cox.net/renny55/button.jpg It doesn't look like it's using a set field ID#, I'm not even sure how it works. I've looked at the subscripts and they look generic - I can't find where it specifically says to fill out the name/address fields with the person being chosen. Could there be a hidden script? I thought maybe the infamous "_buttoncontrol" would be the key, but all it is, is a global text field.
CobaltSky Posted December 30, 2002 Posted December 30, 2002 Most likely the ID# is being set automatically as a consequence of the operation of the relationship which links the two files. When any item is written via a relationship which has the 'Allow creation of related records' option enabled, the key field which establishes the relationship is automatically added to the new record in the related file. This is a standard part of the way that FileMaker automates the management of relationships. In this instance, if your solution is creating new record, all that would be required is to locate the current record, then start working with a related record (as though it already exists, because if it doesn't, it will be created automatically). I've a hunch that may be the reason why you're not able to see a script step that accounts for the ID# being set?!
kenneth2k1 Posted December 31, 2002 Posted December 31, 2002 This looks like the FileMaker Solution Framework. If contractors are stored in the client file, then the same script should work to chose a contractor. The problem is that the related field names are the same, so it will change the client info on the invoice also. If it is set up this way, I would suggest creating a separate file for contractors, then make a script that goes to the contractor file to chose one, or you could have a dropdown box and choose the contractor directly from the invoice. The script you have shown is unfortunately not very useful for troubleshooting because one must know what the external scripts do. From my experience, even given all the script details, there are some things I don't fully understand in the Solution Framework's technique anyway. They do try and explain the steps though. Ken
Newbies renny5 Posted January 1, 2003 Author Newbies Posted January 1, 2003 Thanks for your help everyone. I'm starting to really understand what'g going on now. Ken's right, it's the FM Solution Framework that I've messed with. I used it because I don't know how to write anything but a very basic script. It must have another invisible script that defaults to the products database layout when you open Invoices.fp5, because I've got the main customers/contractors layout at the top of the list and it doesn't come up first...When I started, I actually thought it would be fun to take apart someone else's template... Yes, Ken - the clients and contractors are in the same file and the Contractor's button works to get to the people database in order to choose them, but then it drops the info into the Client fields, not the contractor fields which are named separately as lookups and that's the part of the script I don't know how to change. If I could just tell it to put the record ID (from people.fp5) into the ContractorID field (in invoices.fp5) after it's been chosen, I think it would work. I just don't know how to do that. If you feel like a good laugh, here's a link to it: http://members.cox.net/renny55/filemaker.html Maybe you could see something easy to fix in it that I can't see. Happy New Year to you all! ~renee
kenneth2k1 Posted January 1, 2003 Posted January 1, 2003 Hi: Sorry I cant look at your file right now (Im not at a Mac). As suggested earlier, I would keep contractors stored in a separate file. It makes more structural sense, and it will make reports easier to generate, not to mention make your problem go away. As Ray has suggested, the script may be using a function that is solution-specific. The Framework is an excellent way to implement a database quickly, but it seems that you will have to do some more work. Instead of using your precious time to fix this problem in the manner you wish, you could copy the client file (I think the framework uses "People"), change the name to Contractors and relate it to clients and invoice. If you need further help with relationships, let us know. This is my opinion. Excuse me while I go get inebriated. Happy new year! Ken
Newbies renny5 Posted January 1, 2003 Author Newbies Posted January 1, 2003 that sounds too simple do you mean, instead of having one layout with both client and contractor info, I'd have two separate layouts? Yes, that would make the buttons work. Ok, so I just need to make sure that the clients and contractors are related through the invoice number. Then to make it easy for my client to see, I could create graphic tabs to click to go to the different layouts... I think I can do this! Thanks so much for your help. I'll let you know what happens. ~renee
Newbies renny5 Posted January 4, 2003 Author Newbies Posted January 4, 2003 You're right, of course - that way I can send the people's info to the printable layouts without worrying about clients and contractors having the same field name. thanks again
Recommended Posts
This topic is 7998 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