torifile Posted October 4, 2004 Posted October 4, 2004 Aggghh! Sorry. I FINALLY convinced the powers that be that FM would be a worthwhile investment and now I've got til tomorrow to get this database working.... Let me explain exactly what I'm trying to do and then ask my question. Hopefully that'll make the situation clear. I'm designing a db to track therapist and client appointments. - Each client has a unique ID that I'm using as a primary key. - Each client has one and only one therapist, so the therapist is a field in the "client" table. - Each client will also have several appointments. This is a separate table with client ID as a foreign key. How I'm doing this now is using a portal to the appointments table. The portal has to show several rows at once even though I only want it to show a single row for a new appointment. If I don't show a few rows at once, there is no place for a new appointment to be filled in after the first appointment is scheduled. I'd also like to have a button for "add appointment" but when I do that and assign the button to create a new record, the client_id is no longer automatically filled in. What I'm hoping to do is have the client_id passed along, like I would if I were designing a php/mysql solution (with a hidden value passed between pages). Is there anyway to "pass" values between screens? TIA.
RalphL Posted October 4, 2004 Posted October 4, 2004 Here are 2 ways: 1.) Set the relationship to allow creation of related records. This will give you an extra row in the portal where you enter data to create a new related record. The key is automaticly set. 2.) By script with button, in the script copy the key (unique ID) to a global field, go to a layout for the the related table, create new record, set the key field to the global, go back to the layout with the portal, go to field in portal, go to last portal row.
torifile Posted October 4, 2004 Author Posted October 4, 2004 I appreciate the quick response! Anyway, I've already done the first thing. It seems to work when I first go to layout with the appointment portal. What I'm hoping is to allow creation of new appointments via a button because adding new records via the portal doesn't work through IE or Safari (using IWP). I'll try the second option now.
torifile Posted October 4, 2004 Author Posted October 4, 2004 Here are 2 ways: 1.) Set the relationship to allow creation of related records. This will give you an extra row in the portal where you enter data to create a new related record. The key is automaticly set. 2.) By script with button, in the script copy the key (unique ID) to a global field, go to a layout for the the related table, create new record, set the key field to the global, go back to the layout with the portal, go to field in portal, go to last portal row. Ok, how do I copy the key to a global field? Thx.
RalphL Posted October 4, 2004 Posted October 4, 2004 I use the set field script step. I use a separate table for globals.
torifile Posted October 4, 2004 Author Posted October 4, 2004 I use the set field script step. I use a separate table for globals. Ok. Maybe I'm just dense but I'm still having trouble... I don't see how to use the set field step to make the global equal to the key. Could you provide a step-by-step for me? Thanks for putting up with my slowness this Monday morning.
RalphL Posted October 4, 2004 Posted October 4, 2004 OK here is sort of a generic script. I am calling the Table "Client" and the related Table "Related". Globals is another table. Layout #1 is the layout with the portal. Layout #2 is a layout of the related table. Set Field [ Globals::g_ID; Client::ID ] Go to Layout [ "Layout #2" (Related) ] New Record/Request Set Field [ Related::I; Globals::g_ID ] Go to Layout [ "Layout #1" (Client) ] Go to Field [ Related::item ] Go to Portal Row [ Select; Last ]
Recommended Posts
This topic is 7617 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