March 10, 200619 yr Newbies How do I automatically create a new record if data is hand entered into 3 specific fields. Also, I would like the data from those 3 fields to autofill into the new record that was created. This is all in the same database. Thanks.
March 10, 200619 yr Author Newbies Ok. I will try that. Where do you get s4u Eventscript plug in for Mac OSX. Thanks.
March 10, 200619 yr This is the link for the EventScript plugin: http://www.softs4humans.com/FMPro_Plugins.html
March 11, 200619 yr Hi ekyle, Simply, what you've given us is too brief to give a good solution. Can you fill in the picture for us? Question: User types data into three fields. Where are these fields? What is their name and purpose? What is the data they are entering? What is the User thinking when then type this in? Are you looking for matching records which might already exist and if not, create a new record? Maybe use three global fields. User fills in 1-3 fields and clicks button SEARCH. Script searches if data exists in any of the three fields, performs Find and if no records found, asks User if they want to create a new record. Or maybe even create a new record using a self-join ... but who knows? Come on ... feed us information and we'll feed you back. Provide insufficient, cryptic questions and you'll get insufficient answers. There is very little in FileMaker that can't be handled without plugin. LaRetta
March 11, 200619 yr Author Newbies This is a cow herd database. Each cow has her own record. When a cow has a baby, I would like to be able to fill in the Birthdate of the calf on the cow record. When that specific field has data entered, I want to automatically create a new record and fill the following fields with the exact data from matching fields in the cow record. DOB: Sire: Dam: Sex:
March 11, 200619 yr Nope. You don't need a plugin for this. You simply need a correct relationship. A cow can have more than one baby, right? What happens when a second baby is born? If you use your current plan, the DOB field (in Parents) might already be filled in! So each cow (both Sire and Dam) has a record in your cow db. You should have a cow auto-enter serial number (unique), CowID. The sex of this cow would dictate whether it was a Sire or Dam. Then their offspring should be another table called Children with ChildID (auto-enter serial) and DamID, SireID, DOB and Sex. Information about the Sire and Dam will display through the relationship. A portal of Children, placed on a Cow form would work nicely. If you use 'Allow Creation of Related' then simply typing in the DOB will create a new child record. But either way, you will need to also identify the other parent. Do you currently have any relationship in place? Edited March 11, 200619 yr by Guest
March 11, 200619 yr LaRetta-- I like your solution generally--except that today's Calf might be next year's Sire or Dam, in which case you'd need some way to transfer the Calf record to the Parents table, with a duplication of entries. I would probably have just the one Cows table, with fields for the Sire and Dam of a given cow. But then I'd have to figure out how to show a Cow's calves, since a bull would have to show Sired children, and a cow would have to show Dammed (Question: Aren't they all?!? heh, heh!) children. David
March 11, 200619 yr "today's Calf might be next year's Sire or Dam" Oh David!! That fast huh? I see your point, thank you! Then each record would have a CowID, DamID and SireID. So when a calf is born, a new record would be created in the cow table. Portal wouldn't be necessary on the cow record (to display the Sire and Dam) because there would only be one related Sire and Dam. But a children TO could still display all children. I have no idea how many children a cow can have but I KNOW it's more than one)! This is similar to Employee, Manager structures where the same ID is used for both designations because a person can be both... :wink2:
March 11, 200619 yr Except a manager doesn't need another manager of the opposite sex to manage... You could define a calculation field cParentIDs (result is text) = SireID & ¶ & DamID Then you can have a portal showing offspring using relationship: Cows::CowID = Offspring::cParentIDs Using a calculation, the portal wouldn't allow creation of new records, but there are ways to do that.
March 11, 200619 yr Because every child will (presumably) have both a Sire and a Dam, I don't think it would be advisable to have the portal allow creation, since you'd still have to supply the other parent in the child record. I would probably script this so that the basic Cow layout would have an "Add Calf" button. The script under the button would lead to a second layout of global fields for the Calf's information--including Sire and Dam dropdowns. Based on the initial parent cow's sex, I'd set the appropriate gSire or gDam, making it easier to select the other parent. The "Commit" button would actually enter the Cow record once all the necessary info on the layout had been supplied. David
March 13, 200619 yr Author Newbies Please forgive me, even though I have used filemaker for several years, I am new to scripts and portals. Correct me if I am wrong, but there must be an easier way. I have attached a screen shot of my basic cow record. What I would like to have happen is when I fill in the "Calving Date '06 field" a new record is created. (it can look just like my basic cow record) In that new record I would like "DOB" to be auto filled with the same date from "Calving Date '06" I would also like the new record to autofill the "dam" field using the information from the "Tag number" field from the original cow record. Also, autofill the "sire" field in the new record with the information from the "bull turned in '06" field from the original cow record. Basically, all I am trying to do is to keep from double punching as much data as possible. And to LaRetta, I am sorry, I probably should have explained it this way from the beginning, but I didn't have the database this far along yet. Picture_1.pdf
March 13, 200619 yr This is not a good way - what will you do in 2009? See if the attached gives you some ideas. Cows.fp7.zip
March 14, 200619 yr comment-- I'm amazed at all that can be accomplished with so little! But, can you explain how the Sex field stores 0/1, but displays M/F? David
October 22, 200619 yr Newbies Thanks a lot about the EvetScript Plugin! It's cool and very useful (and free of course...) Regards from Canary Islands (Spain). Ciao!
Create an account or sign in to comment