February 19, 200421 yr Ok, I'm stumped with this. I know I'm not thinking about this the correct way. So I'm asking for help. Situation: Main database: portal1 --> contact database, portal2 --> phone log database What I want to do is have the user click a button in portal1 to record phone call information. The button should actually create a record in the phone log database. I'm creating the phone log functionality right now and this is where I'm stuck. the main database has a relationship to the contact database via a field in both called recordID. I'm willing to setup any type of relationship to the phone log database. Any help is greatly appreciated. Paul
February 19, 200421 yr Hi, When selecting a Contact from the Contacts portal, store the selected contact ID in a global (or text field). This could be done by a one line script from a portal row. SetField["gContactID", "ContactsbyConstant::ContactID"] The phone log database could relate back to the Main file with a relationship gContactID::ContactID, and you could even set this relationship to "Allow creation of related records". If you want to have it automatically create a related record as soon as a contact is selected, then create priorly a script in the Phone Log Db 'Create New Record' NewRecord SetField["contactID", "ConstantToMain::gContactID"] Then, modify the first script so that it becomes SetField["gContactID", "ContactsbyConstant::ContactID"] PerformExternal[PhoneLogFile, "Create New Record"] According to where you'd like to enter data, you'd add a Refresh step to either of the scripts. FYI, by "Constant", I mean a relationship based on a constant value, in all files, set to a number autoentered value of 1 (for example) HTH
February 20, 200421 yr Author Ugo, I understand most of what you posted. The "Constant value" portion I'm not sure about. If I'm understanding you correctly I need to create a field "ConstantToMain" (could be any name) and set it to a constant value and I need to do this in every database in my solution? () Can you create a simple example? I think I understand but I do better we examples I can play with.
February 23, 200421 yr A constant relationship is established by using on both side of your relationship the same value. The easier is to create a number field, and to set it to be auto-entered with a value of 1. Ok, I'll try the test file approach..
February 24, 200421 yr Author Ugo, thanks for the help. I ended up using global fields and a sort of static link between the files. My recordID field in each database links back to the main field. RecordID is static for a particular school but each of the 122 schools has a different ID. So far I haven't come up with a reason why my version wouldn't work. I also came to the realization that the main reason my script didn't work in the first place is that the global fields from the main db were not in the layout that I was trying to paste field values into. Once I followed your advice and put the global values into the layout everything worked. Again. thanks.
February 24, 200421 yr pmconaway said: I also came to the realization that the main reason my script didn't work in the first place is that the global fields from the main db were not in the layout that I was trying to paste field values into. AVOID USING COPY/PASTE....use SetField[ ] instead...
Create an account or sign in to comment