Multiple Selection Problem

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 10
Joined: Sat Oct 16, 2010 5:59 am
PostPosted: Sat Oct 16, 2010 6:39 am
I am a self-taught relative newbie to FileMaker and apologize if my question is ridiculously simple but I have been unable to solve a problem via a review of the online documentation or via searching topics in this forum.

Ultimately, my question may stem from a misunderstanding of what is intended by the "Multiple Selection" script parameter. (My hope is that it means that the user can select multiple records in a portal or, at least, that selecting/deselecting a portal row will add/subtract the record's ID to a list contained in the FieldName_SelectedIDGlob.)

I am trying to create a pop-up window for the user to choose a number of lab tests for a given patient. I have copied (and modified field/variable references) the Select Contact { ContactID ; Multiple Selection }, Select Contact - Click on Contact {ID}, Select Contact Continue {Cancel}, and Select Contact - Find Contacts {Show All} scripts.

I have a button that performs the script Select Lab Set { LabSetID ; Multiple Selection } and passes through the script parameter: "Multiple Selection = 1".

On the Mini -Select Labs layout that the script opens, I have created a button in the portal rows performing the script: Select Lab Set - Click on Lab Set {ID} and also have it passing through the script parameter "Multiple Selection = 1".

While my hope was that this would allow the user to select/highlight multiple portal rows (either directly or while holding down Shift or Command Keys) and to have the list of LabSet record IDs sent to the SelectLabSet_SelectedIDGlob field, this does not occur. In fact, I can't see any difference between sending or not sending the "Multiple Selection = 1" parameter.

I do look forward to any help or clarification that you may have to offer.

JLKoch
Jack L. Koch Jr., M.D.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Oct 20, 2010 6:29 am
Hey Jack,

Seems we have a bug in this multiple selection code. I've gotten it repaired here but need to write up some instructions so you can effect the repair on your end. Will post them soon.

Nice catch!

- John
John Sindelar
SeedCode
Posts: 10
Joined: Sat Oct 16, 2010 5:59 am
PostPosted: Tue Nov 09, 2010 8:29 pm
I did get it to work, eventually but I certainly anticipate that your solution is much more eloquent than mine. I do look forward to hearing back about the fix.
Jack L. Koch Jr., M.D.
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Wed Nov 17, 2010 11:43 am
John Sindelar wrote:Hey Jack,

Seems we have a bug in this multiple selection code. I've gotten it repaired here but need to write up some instructions so you can effect the repair on your end. Will post them soon.

Nice catch!

- John


Hi John - just ran into the same issue with multiple selections. Hope you'll post a fix soon. Thanks! John Swart
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Mon Dec 06, 2010 9:14 am
John Sindelar wrote:Hey Jack,

Seems we have a bug in this multiple selection code. I've gotten it repaired here but need to write up some instructions so you can effect the repair on your end. Will post them soon.

Nice catch!

- John


Hi John! Know you've been busy with all the new Zulu features. Hoping you'll be able to post the instructions for selecting multiple items soon. I really need it for a project I'm working on now.
thanks!
John Swart
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Dec 06, 2010 9:27 am
Ack! Sorry. I'll post these today between calls. Thanks for the reminder.
Last edited by John Sindelar on Mon Dec 06, 2010 5:35 pm, edited 1 time in total.
John Sindelar
SeedCode
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Mon Dec 06, 2010 10:38 am
John Sindelar wrote:Ack! Sorry. I'll post these today between call. Thanks for the reminder.

Thanks John!
John
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Dec 06, 2010 5:31 pm
Fixing the multiple selection problem...

1. Edit the script "Select Contact { ContactID ; MultipleSelection }" and add a new SetVariable line right before the comment "Record contact originally selected". Set the variable "$sc_ContactID" (without quotes) to this:

SeedCode_RemoveExtraReturns ( $sc_ContactID )

2. Edit the script "Select Contact - Click on Contact { ID }" and change the calc in the SetField statement, replacing this line...

Not IsEmpty ( FilterValues ( ID ; Contacts::_id ) ) ;

...with this one:

IsEmpty ( FilterValues ( ID ; Contacts::_id ) ) ;

3. Edit the layout "Select Contact" and click on the conditional formatting for the long which rectangle in the portal row; this is most easily clicked on at the far right edge of the portal row. Change the conditional formatting calc from this

SelectContact::SelectContact_SelectedIDGlob = Contacts::_id

...to this:

not isempty ( FilterValues ( SelectContact::SelectContact_SelectedIDGlob; Contacts::_id ) )

Note that you'll also want to do that with the conditional formatting on the fields the portal.

That's it!
John Sindelar
SeedCode
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Mon Dec 06, 2010 7:43 pm
Thanks John, will give it a try in the morning!
John
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Mon Dec 13, 2010 11:57 am
Hey John - The fix works to select multiple contacts, but it seems to add a line feed to the global field when you select the first contact. If you unselect and select again then the line feed is deleted. I can trap for it when I loop through the list, but would be easier not to have it in the first place. Suggestions?
Thanks! John Swart
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Dec 13, 2010 12:23 pm
Unless I'm not following you John, this field isn't something a user sees, so the leading return doesn't matter, right?
John Sindelar
SeedCode
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Mon Dec 13, 2010 12:47 pm
It is in the background, but it does matter because I take the SelectContact_SelectedIDGlob (which is a list in multiple selection) and put it in a variable. Then I loop through the variable grabbing each line to add the contact ID. Make sense?
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Dec 13, 2010 1:23 pm
Gotcha. So change this...

Edit the script "Select Contact - Click on Contact { ID }" and fine the SetField line. Inside that calc, replace this line...

ID & ¶ & Contacts::_id ; // add to list

...with this one:

SeedCode_RemoveExtraReturns ( ID & ¶ & Contacts::_id ) ; // add to list

Best,

John
John Sindelar
SeedCode
Posts: 15
Joined: Thu Mar 06, 2008 6:23 am
PostPosted: Mon Dec 13, 2010 1:45 pm
Oh Sure - works just right when you write it down. I could have sworn I tried the remove extra returns function and it botched things up. Obviously I just don't have the magic touch yet.

Thanks!
John

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 1 guest

(855) SEEDCODE
[email protected]
Follow us: