oscarbum Posted March 1, 2006 Posted March 1, 2006 It's funny. I spend so much time tweaking these databases that I've created that when it comes back to creating a new database for someone, I completely forget the basics. My client wanted to add a calendar db to the parent. No prob. But the 3 lousy fields that need to carry over to a given day on the calendar seem to refuse to do so. I created a new ID field on the parent and a mathing ID field for the calendar. Did all the steps for defining the relationship, but the fields on the calendar stay blank. I figured I would post this for good luck since I always seem to solve the problem within minutes of asking the question. But if someone would please post the answer, I'd appreciate it.
oscarbum Posted March 1, 2006 Author Posted March 1, 2006 (edited) Oops. Sorry. Brain is completely fried. I guess I'm wondering if there's that one little step that gets missed a lot that I might be missing here. Because I even went back to another similar database I designed and I can't spot the difference. Let me be more specific. This is for a law firm. There's a case file database (Parent) and calendar db (child) with the name of the case, name of the judge and courtroom (all in the parent) needing to carry over to the child. I created a button on the parent to open the child db and perform script on the child. The script on the child adds a new record to the child. However, the new record on the child has blank fields where the info from the parent should be. When I created the fields, it allowed me to use the relationship, so I know it works to a point. Does anyone have an idea based on that as to where I'm going wrong here? Edited March 1, 2006 by Guest
Genx Posted March 1, 2006 Posted March 1, 2006 You do add a foreign key to your child table right? I.e. your parent id? Then commit the record and pull the info through the relationship? Another way you could do this is create a seperate TO with the same relationship and maybe a timestamp field in the child table and an unstored timestamp calc in the parent table to ensure uniqueness, enable record creation in the child table via this relationship and then just set your child fields equal to whatever in the new creation TO. ~Genx
comment Posted March 1, 2006 Posted March 1, 2006 The easy way to do this is to have a portal to the Calendar file on the Cases layout, and allow creation of Calendar records in the definition of the relationship (I presume the relationship is matching CaseID to CaseID). This will enable you to type a date into the last portal row in order to create a new related record. Alternatively, you will need to tell the new record in Calendar which Case it belongs to. In version 6, you need to store the CaseID in a global field, so that you can get at it when you are in Calendar. So your scripts need to be roughly this: in Cases: Set Field [ gCaseID , CaseID ] Perform Script [external] in Calendar: New Record Set Field [ CaseID , Cases::gCaseID ]
oscarbum Posted March 3, 2006 Author Posted March 3, 2006 Well, I'm having a very strange problem with it now. It adds a related record to the calendar (does the info from the parent need to be in a portal to work?), but if I type anything in those fields on the Calendar file, it creates a new record in the parent AND carries the info over. Basically, it's doing what I need it to do but reversed.
comment Posted March 3, 2006 Posted March 3, 2006 If you are using a portal to create the dates, you shouldn't be typing anything in the Calendar file - you can enter all the information into the portal. In fact, the Calendar file can remain hidden at all times. Also, the relationship from Calendar back to Cases should NOT be allowed to create records.
Recommended Posts
This topic is 6898 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