Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Relationship/Portal problems

Featured Replies

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

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

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

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

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

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

  • Author

Yes, that is what I'm doing.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.