Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Get related records not in table


jf0027

Recommended Posts

Hi,

 

I've tried for a while to do this but can't do exactly what I want. Here's what I've got. I've got three tables: Person, Member, Club. They are related has the following:

 

Person | | Member | | Club

 

I can create and delete members without any problems. What I want is the list of person that is not a member of a particular club. To do this I probably need another related table but my tries didn't worked. In SQL, you would to like this:

 

SELECT Person.pid

FROM Person

 

EXCEPT

 

SELECT Member.pid

FROM Member

 

Its probably something obvious but I can't seems to find it.

Any suggestions?

 

Thanks

Link to comment
Share on other sites

Greeting jf,

 

I think a couple more details would be helpful:

 

Do you want a portal list or change the found set?

 

Do you want to find Persons that don't have any Memberships or those that don't have a Membership to a specified club, like "Find those that aren't in the Basketweaving club".

Link to comment
Share on other sites

Thanks for the fast reponse.

 

Here's more details:

 

I want the non member of a particular club (ex: not a member of golf club).

 

I want this for a portal list or a value list. In both case, I don't think it is going to be different.

Link to comment
Share on other sites

I believe you will need a custom function (or looping script) to build the key on the parent side to make this type of exclusion list possible. Something like DifferenceValues() or NotList() using the list of all PersonIDs and the list of "golf" Membership PersonIDs as inputs.

 

Anyway, I think I have a sample at home that shows how it all works. I'll dig it up tonight if you don't have it solved by then.

Link to comment
Share on other sites

The solution I found is a bit hard to explain in detail. Attached is a sample using a CF as I described above (you will need to upgrade your membership to download).

 

There may also be a method without using CFs. But in either case, I believe you would still need a script with a Refresh Window[Flush cached join results] to get the list to update as changes are made.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use