Jump to content

So close - one piece of portal puzzle missing


Aleesha

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

Recommended Posts

Hi everyone!

I am so close to completing my little database and I have one more thing I would like to be able to do. 

I have a "Look up" section where I can see the details of an individual. I want to do display which activities they have attended. 

Activities are in a separate table. People are connected to activities via the affiliation table. I am selecting people who attend an event by a portal. 

I just cannot get this look-up portal to work. I do not know what is wrong!

Any ideas?

You guys are the best :) 

People and Activities_Jul20.fmp12

Link to comment
Share on other sites

Hi Aleesha,

Your Lookup layout is actually your Contact layout.  It would be where you list Contact data and display a portal to Affiliations and add an Activity to the Contact.  BTW, you had ContactID set as a global field which won't work so I changed it back to regular auto-enter serial number.  So now you can add Contacts to the join table.  Below that, I placed a portal to Activities which lists only the activity they attended.  This portal might or might not be needed but if you wish for a unique list of Activities they attended, then you can use it that way.  Turn off entry to fields in Activity and do not check 'allow creation' into the Activity table.

Notice I created a value list of Activities (the ID and also displaying the description) to make selecting an Activity easier.

 

People and Activities_MOD.fmp12

Link to comment
Share on other sites

Hi LaRetta, 

Thank you for your help. What was it about my portal that wasn't working? I keep looking back and forth between yours and mine and I do not see why my similar portal did not work!

Link to comment
Share on other sites

You had browse mode unchecked on the ActivityID field in the portal so you couldn't create the new record.  But it's also important that ContactID not be global. :-)

40 minutes ago, Aleesha said:

I want to do display which activities they have attended. 

I originally thought you wanted a portal showing only the unique Activities, which is why I gave you both.  :-)

Link to comment
Share on other sites

I see, okay. I still need to figure out what "global" means! I thought I was being proactive, oops. 

Is there a way for this list to auto-populate? If I understand correctly I will need to select the activities from the drop down list above to populate the table below. This is what I have been struggling with (oh, and a bunch of other things, haha) 

Link to comment
Share on other sites

The table below is the Activities table.  When you select the Activity in the upper Affiliates table, it inserts both the ContactID and the ActivityID into the Affiliates table.  Since the Affiliates table is linked to Activities, that relationship (for that Contact) is now complete and the unique Activity will now automatically appear in the lower Activities portal.  You will have to commit the record (click outside the portal or into another field) to see it appear below.

A global field's value is the same for every record in the table so if you typed a 1, ALL Contacts would then have ContactID 1 which isn't what you want.  Global fields can be accessed from any other table without a relationship and they are handy mostly for Developer work but for real data, you want to use stored values.  In the case of ContactID, you need a unique serial for every Contact record so you can tell one from the other.

Edited by LaRetta
corrected small typo
Link to comment
Share on other sites

So when I am putting contact names in the Activity form and creating entries in the Affiliations table, those relationships are not complete? I had assumed that since ContactIDs are linked to ActivityIDs in the Affiliations table, I could simply pull and display the filtered listed of ActivityIDs based on ContactID through a portal to the Affiliations table, without having to commit the record...

Thank you for taking the time to explain this to me, I really appreciate it. 

Link to comment
Share on other sites

48 minutes ago, Aleesha said:

Is there a way for this list to auto-populate?

Well, that's what the Affiliations table does.  You must tell the computer that 'this Contact wants to attend a certain Activity so you select the Activity.  One the relationships knows the ContactID and the ActivityID for the Affiliations table, you're set to go.  Committing the record is necessary for the Activity relationship to 'see' the new Affiliations record.

39 minutes ago, Aleesha said:

I had assumed that since ContactIDs are linked to ActivityIDs in the Affiliations table,

The People::ContactID is related to the Affiliations::ContactID so when you create an Affiliation record, the ContactID is automatically inserted into Affiliations to assist in the relationship.  But it still needs to know which Activity and when you choose the Activity in the Affiliations table, the Affiliations record isn't REAL to the Activities relationship until you commit or exit the portal.  But if you are displaying the Affiliations portal, why do you need to also display the unique Activities portal?  That lower Activities portal will never display an Activity record that the current person isn't a member of.

Asking questions is always okay here, Aleesha. :-)

Are you actually looking for a way of displaying ALL ACTIVITIES in a portal, even ones the person does not belong in?  I guess I should have asked you for the specific purpose first.

Edited by LaRetta
added sentence
Link to comment
Share on other sites

I should also mention, Aleesha, that sometimes we use script triggers to force a refresh if a portal really needs to display immediately but it depends upon what you're doing because if you are adding multiple Affiliate records, the lower Activities portal will update once you move on.

You will also want to probably show scroll bar on the portals.

Link to comment
Share on other sites

Hmm. I can't seem to get this to work the way I would like it to. 

I have three events, and my three test participants have each attended some. 

Riker - event 1 and 2

Ranger - event 1

Elsa - event 3

When I go to the Look Up tab to learn more about Elsa's past with our organization, in the Affiliations_Activities drop down list I see all 3 possible events. 

For Elsa, I then selected two events she did not attend and they appeared in the Activities attended portal below. This then appeared in the Activity form as a 3, which suggests the Look Up form is creating records in the Activity form using the AffiliationID. 

I do not want to be able to enter information in the Look Up form. I just want to know where we last saw Elsa, so it is easier to remember our volunteers and members.

I must be misunderstanding something here :( 

 

People and Activities_Update1.fmp12

Link to comment
Share on other sites

Here is how we force refresh.  Script trigger attached to the Affiliations::ActivityID field that, when modified refreshes the lower portal.  Notice that I object named the lower portal.  This makes it update immediately.

 

 

People and Activities_MOD2.fmp12

We cross posted.  Please stand by while I review your file.  :-)

---- after reviewing ----

In Activities, Person portal ... the first two records were inserting the person's NAME into the personID field.  Go to your Affiliations table and check it.  Delete those two records.  It should insert the ContactID not name.  To know, create a value list named People.

Base it values based upon field, People and select ContactID in the left pane and full name in right pane.  Below, specify display all values.  Just duplicate how I set up the Activity value list.

Then go to your Activity table person portal and on the ContactID, change it to use popup based upon the new People value list.

By the way, it is simpler if you name the table the same as its primary ID, in this case 'Contacts' or rename the ContactID to PersonID.

Edited by LaRetta
Link to comment
Share on other sites

I also want to explain that you saw the 3 because you didn't have a popup list attached to the field.  Popups insert the ID but DISPLAY the name.  If you re-select the 3 and select Elisha, it will correctly display, same with the others - re-select them.

Link to comment
Share on other sites

4 hours ago, Aleesha said:

This then appeared in the Activity form as a 3, which suggests the Look Up form is creating records in the Activity form using the AffiliationID. 

Aleesha, I just want to be sure you understand this point:  It does NOT create records in the Activity table but only in the Affiliates table which appears in that Affiliates portal.  It only displays on the Activity layout because they are now related.

4 hours ago, Aleesha said:

I just want to know where we last saw Elsa, so it is easier to remember our volunteers and members.

So, if you are on Activities and you want a unique list of the last time you saw Elsa even if it was on ANOTHER Activity other than the current one currently being viewed?  Is THIS what you want displayed in that portal?  Hey, don't get discouraged, this isn't the easiest form of communication.  We'll get there.  :-)

Link to comment
Share on other sites

This topic is 2443 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.