117Alan Posted April 7, 2008 Posted April 7, 2008 Hi I am creating a database (FMP8.5 advanced) for sending invoices to clients. Each invoice has a unique account reference number, a specific date and time fields and then several item numbers with fees. The item numbers and fees are on a separate table and are viewed via a portal. I would like to duplicate the record for that individual, so that I can create a new account, using some data that is repeated from the previous account, like the name, address, date of birth etc but I do not want to duplicate the information in some of the fields eg previous date of service and the previous item numbers and time fields. Should I be looking at a script that duplicates data in selected but not all fields and then attach that script to a button called for example “create new record”? If so can you please help with script steps to duplicate the data in selected but not all the fields? Or is there another better method? Thank you,
Søren Dyhr Posted April 7, 2008 Posted April 7, 2008 Depending on the remainder vs evaporator ratio, would I exploit the fields autoenter facilities' knowing which script actually performed the duplication. Since you're on a developer version, have I made it CF'ed... --sd DupeAllOrSome.zip
117Alan Posted April 8, 2008 Author Posted April 8, 2008 Thank you for your thoughts and the script / calculation. Unfortunately your solution is not quite what I am after. Also I am not quite sure what you mean by: remainder vs evaporator ratio and CF'ed... --sd Nevertheless I appreciate your time and effort.
Søren Dyhr Posted April 8, 2008 Posted April 8, 2008 Unfortunately your solution is not quite what I am after. Mission statement please?? remainder vs evaporator ratio and CF'ed... How many fields which should be affected by the implementation vs. the ones not. It could eventhough I made a CF (custom function) be a burden for the system to maintain. I have no idea of how flat'ish your relational structure might be, if the solution is normalized into 5th doesn't any field exist in the same table as the duplication is done in ... they're related and won't be updated by things happening to a table a relation away. You should know when asking in abstract in a forum like this or any for that matter - are the chances anyone will hit it right on initially, would be taking long odds. Please explain why you have the need and when - purpose and context. Here is it only the matters in the portalrows, if it is - can it still be pulled off: http://www.fmforums.com/forum/showtopic.php?tid/192150/fromsearch/1/hl/duplication/tp/0/all/1/ ...where you then put in the scripted exceptions I showed in my template. --sd
117Alan Posted April 17, 2008 Author Posted April 17, 2008 Hi Søren and others Can it be this simple? These are the script steps I used, attached to a button Show Custom Dialog[“Duplicate account”; “Do you wish to create a new separate account?”] If[Get(LastMessagaeChoice)=1] Duplicate Record/Request Clear [select; Biller::AccountRefereceNumber] Clear [select; Biller::DateOfProcedure] Clear [select; Biller::StartTime] Clear [select; Biller::FinishTime] Go to layout [original layout] Go to field [biller::AccountRefereceNumber] End If By the way how can I copy my script from FileMaker Script maker and then paste it to a non FileMaker application like a word document or into this forum? At present when in script maker if I copy the script the only option to paste it is into another script in the FileMaker program. Thanks again for you help.
comment Posted April 17, 2008 Posted April 17, 2008 Can it be this simple? Actually it can be a lot simpler if, instead of duplicating a record and erasing the fields specific to an account, you would create a new RELATED record for each account - leaving the common data in a SINGLE parent record for each individual. The way you have it now, if someone has 5 accounts, and they change their address - you need to update 5 records instead of one.
David Jondreau Posted April 17, 2008 Posted April 17, 2008 Comment's response is probably the best overall advice, but the easy answer to your question is to go to the field definitions for the fields you don't want to duplicate, check the data auto-enter checkbox and leave it blank.
117Alan Posted April 21, 2008 Author Posted April 21, 2008 Thanks for those elegant solutions and advice. I see what you mean that it could be a problem if a person changes their address then you have to update all the previous records. However maybe there is no reason to change them? It might not matter what their previous address was as long as the invoice relating to those details has been paid then that account has been settled. That being so, perhaps another thing to consider when creating a duplicate account is to have a line of text that appears something like: “please check that all details eg mailing address are still correct” before allowing the user to duplicate Thanks again
comment Posted April 21, 2008 Posted April 21, 2008 It might not matter what their previous address was as long as the invoice relating to those details has been paid then that account has been settled. That's possible. I am not sure what "account" means in your description, and how it differs from an invoice. But the address was just an example. Clearly, you are (a) storing the common data in more than one place, and (: doing more work than necessary. That's why splitting the data into two tables would be more appropriate. Note that keeping duplicate data is sometimes desirable, for example if you have Clients and Invoices, you may want the invoice to store the client's address as it was at the time the invoice was created. The way to do this is to have the invoice lookup the address from the client's record. This way, the client's record is kept up-to-date at all times, but a change of address will affect only future invoices. I believe that is a more elegant solution than asking users to hunt for changes every time they create a new record.
David Jondreau Posted April 21, 2008 Posted April 21, 2008 Note that keeping duplicate data is sometimes desirable, for example if you have Clients and Invoices, you may want the invoice to store the client's address as it was at the time the invoice was created. The way to do this is to have the invoice lookup the address from the client's record. This way, the client's record is kept up-to-date at all times, but a change of address will affect only future invoices. I believe that is a more elegant solution than asking users to hunt for changes every time they create a new record. In this situation, I'd go with a table of Addresses and a join table for Addresses and Invoices.
comment Posted April 21, 2008 Posted April 21, 2008 I am not sure about that. See: http://www.fmforums.com/forum/showtopic.php?tid/186768/post/253766/#253766
LaRetta Posted April 21, 2008 Posted April 21, 2008 By the way how can I copy my script from FileMaker Script maker and then paste it to a non FileMaker application like a word document or into this forum? At present when in script maker if I copy the script the only option to paste it is into another script in the FileMaker program. Open ScriptMaker, select the script (but don't open it). At bottom, select Print. Print to PDF. Open PDF, Edit > Select All and copy it; paste it where you wish. You can also install a text only printer which will print to text document and there may be other ways as well but I like the way this formats and looks when copied (I use it for creating tech docs). LaRetta :wink2:
117Alan Posted April 23, 2008 Author Posted April 23, 2008 Hi LaRetta Thanks, I was hoping someone would spot the question about coping and pasting the script steps. I have tried what you suggested but when I open script maker and then select the script I get the following options: (see attached) I do not (in this menu area) seem to have the option (print to PDF) that you referred to? Alan
LaRetta Posted April 23, 2008 Posted April 23, 2008 (edited) Select PRINT. When it opens, open your printer list and find Print to PDF. UPDATE: Hmmm, I was telling you according to vs. 9 which has the print icon at the bottom of the screen. But I had said "Select Print. Print to PDF." I wasn't clear that it was two separate steps and saying 'at the bottom' probably threw you as well. Edited April 23, 2008 by Guest Added update
117Alan Posted April 24, 2008 Author Posted April 24, 2008 Hi I should have mentioned that I did try a few options after âselecting printâ, before sending my last post. I have also explored all the (advanced) properties of all the available printers, it does not seem like I have an option to print to PDF. Cheers
LaRetta Posted April 24, 2008 Posted April 24, 2008 Sorry, I thought it came standard in Windows. You can download a free PDF printer. Here's one I used to use in vs. 6: Cute PDF Writer ( used to be called Cute PDF Printer )
Recommended Posts
This topic is 6058 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