skuli Posted July 10, 2001 Posted July 10, 2001 Hey All, Does anybody know a way to remove the current record (i.e. Dick) from the portal when using a self relationship (so we only see Jane and Spot in the portal)?
Kurt Knippel Posted July 11, 2001 Posted July 11, 2001 quote: Originally posted by skuli: Hey All, Does anybody know a way to remove the current record (i.e. Dick) from the portal when using a self relationship (so we only see Jane and Spot in the portal)? Use a calculated key to do the join. Assuming that the "self-relationship" is something like "FamilyID", then you could set either a global or an unstored calc (lets call it CurrentID) to the PrimaryID of the record. This establishes what the current record is. Now setup a cFamilyID = if ( PrimaryID = CurrentID, "", FamilyID ). Finally setup your relationship as FamilyID::cFamilyID. This setup causes cFamilyID to only be valid if it is not the current record. Of course there are hundreds of other ways to do this as well, in addition to many varations on this theme. It all depends upon your EXACT needs and style.
skuli Posted July 11, 2001 Author Posted July 11, 2001 Thanks, but I'm not sure I understand everything you are saying. Let me explain the situation exactly so we can at least talk apples to apples. I have a names db and within that db is a portal with a self joining relationship of a unique company key. The portal then displays other people who work for this company. What I don't want to see is the persons name of the current record within the portal. What I'm not clear about is setting the global field. Each record in the db has a unique ID (PKey). So therefore each person has a unique ID and each company has a unique ID. I don't understand what this is: cFamilyID = if ( PrimaryID = CurrentID, "", FamilyID ) and it seems to me that if the portal relationship is set to see if the current record ID is equal to the current person, then nobody would show up. Where have I gone wrong?
Kurt Knippel Posted July 11, 2001 Posted July 11, 2001 quote: Originally posted by skuli: Thanks, but I'm not sure I understand everything you are saying. Let me explain the situation exactly so we can at least talk apples to apples. I have a names db and within that db is a portal with a self joining relationship of a unique company key. The portal then displays other people who work for this company. What I don't want to see is the persons name of the current record within the portal. What I'm not clear about is setting the global field. Each record in the db has a unique ID (PKey). So therefore each person has a unique ID and each company has a unique ID. I don't understand what this is: cFamilyID = if ( PrimaryID = CurrentID, "", FamilyID ) and it seems to me that if the portal relationship is set to see if the current record ID is equal to the current person, then nobody would show up. Where have I gone wrong? You have a PrimaryID and a CompanyID, not knowing this, I called it a FamilyID. Everyone who works for the same company should have the same CompanyID, but everyone should also have a unique PrimaryID. What you need to do is to setup a way to know "which record is the current record". Store that value in the CurrentID field. So that cCompanyID = if ( PrimaryID = CurrentID, "", CompanyID ). Again setup your relationship as CompanyID::cCompanyID.
Recommended Posts
This topic is 8628 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