AnsweredAssumed Answered

NEED HELP... FOUNDSETS

Question asked by KaraAmsinger on Jan 14, 2010
Latest reply on Feb 4, 2010 by philmodjunk

Title

NEED HELP... FOUNDSETS & GROUPS

Post

Hi All,

I have already received some assistance with this but I have one last obstacle to get through...

I have a database that was build using the BPS as a template. The database consists of 3 separate files MainMenu.fp7, Contacts.fp7, Email.fp7. I am using FMP 10.1 Advance and I am on a shared network using FMP Server Advance 10. 

So here is what I am in the process of setting up. 

I want to be able to perform a find in the file Contacts.fp7, Table: Contacts, Layout Form View Contacts. I have set up a button on this layout called "Save this Found Set?" with a script that takes all the ContactIDs and puts them in another Table: FoundSets within the same file Contact.fp7. The ContactIDs are put into a IDList field that is in the Table Found Sets. I have provided the Button script below...

Script: "FoundSet" applied to button on Contacts Table called "Save this Found Set?"

/beginning of script

Allow User Abort[Off]
Set Error Capture [On]
Go to Record/Request/Page [First]
Loop
   Set Variable [$IDList; Value:Contacts::Contact ID & "¶" & $IDList]
   Set variable [$Folder1; Value:Contacts::Folder1 & "¶" & $Folder1]
   Go to Record/Request/Page {Next; Exit after Last}
End Loop
Go to Layout ["FoundSets" (FoundSets)]
New Record/Request
Set Field [FoundSets::IDList; $IDList]
Set Field [FoundSets::Folder1; $Folder1]
Perform Script ["Portal to GTRR" from file: "Email"]
#Set any other fields in Foundsets you need to identify this found set record so that you can find it again. 

/end of script

So the above script takes all the ContactIDs in a found set and puts them into an IDList in another layout so that through another script called "Portal to GTRR" I copy those Contact IDs into the file email.fp7, Table: Groups, Layout: Form View Groups, into a Portal that will display each person assigned to a Contact ID that was in the FoundSet. Let me provide the script "Portal To GTRR" for your review then explain what the issues are.

Script: "Portal to GTRR" in file: Email.fp7 (This is the script that is the "Perform Script" in the above script)

/beginning of script

Allow User Abort[Off]
Set Error Capture [On]
Go to Record/Request/Page [First]
Loop
   Set Variable [$ContactID; Value:Contacts::Contact ID & "¶" & $ContactID]
   Set variable [$GroupName; Value:Contacts::Folder1 & "¶" & $GroupName]
   Go to Record/Request/Page {Next; Exit after Last}
End Loop
Go to Layout ["Form View Groups" (Groups)]
New Record/Request
Set Field [groups_GroupContacts::Contact ID; $ContactID]
Set Field [Groups::Group Name; $GroupName]
#Set any other fields in Foundsets you need to identify this found set record so that you can find it again. 

/end of script

SO HERE IS THE PROBLEM...

When the ContactIDs appear in that FoundSet layout they are all listed out in 1 field IDList with a carriage return after each Contact ID. When the ContactIDs are then Imported into the Table: Groups, Layout: Form View Groups, into the Portal on that Layout all the ContactIDs are listed out in 1 portal row. Therefore, I can not see all the people I have imported in that Portal. I need to have 1 ContactID per Portal Row... I just can't seem to find in the scripting where the problem is and have tried several things to separate out the Contact IDs, one to a portal row. I am not sure if my problem is how they are listed on the Table: FoundSets in the field IDList or how they are sent over to that other Table: Groups, Layout: Form View Groups that has the Portal. I have setup all my relationships (at least I think I have). I am willing to email anyone my 2 files (Contacts & Email.fp7) to review and see where the problem is if the above does not reveal the issue.
 
Also in both scripts I have tried to set it up so that what ever label is selected in "Folder1" is the "GroupName" in that table Groups. Not sure if you are able to help w/ that, but the first issue is more important to me. 

I truly appreciate any help on this!

Sincerely,
Kara

Outcomes