Jump to content

Relationship/Portal problems


pmconaway

This topic is 7360 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

This topic is 7360 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.