April 30, 201213 yr Newbies Hello everyone, I'd like to be able to use a checkbox or radio button set to specify a "default" entry in a portal. For example, I have a membership database, and in a member record, I show a portal of his/her addresses. Since each member can have multiple addresses, I'd like the user to check a box/radio button to specify which of the addresses shown in the portal is the default address for that member. Easy enough to add a checkbox field... However, I'd like this checkbox to act like radio button sets, where you can only have one checked at a time. The problem is that the context of a radio button set is a record and I want it to be the portal, so I can have one checkbox per record and have them automatically clear if I select a different record in that portal. Any ideas? Thanks for any help, Fernando
April 30, 201213 yr Who not store the ID of the default address in the contact record itself. then a simple button sets that field with the selected address record.
April 30, 201213 yr Author Newbies John, That is exactly what I'm doing already. However, that way I could check multiple portal rows (on purpose or by accident), thus making multiple addresses the "default" and completely defeating the purpose of having a default in the first place. I know... Tell the user to not do that. Yes, I even have a tooltip that mentions only checking one box, but I much prefer to prevent the user from multiple checks if I can. -F
April 30, 201213 yr I use a similar technique with primary addrsses and phone numbers. I display a radio button on each record of the portal to show which is the primary. The underlying value is a 1 or a 0 but the value list attached is simply 1. I formatted the radio button to actually be a button that triggers a script. The script goes to the related records ( showing all related ), uses replace field contents to set all to 0 and then sets the selected primary to 1.
April 30, 201213 yr Who not store the ID of the default address in the contact record itself That is exactly what I'm doing already. However, that way I could check multiple portal rows (on purpose or by accident) No, you couldn't. An address should be selected as default by performing: Set Field [ Members::DefaultAddressID ; Addresses::AddressID ] This will replace any existing value in the DefaultAddressID field with the AddressID of the address record residing in the portal row where you clicked to perform the above script step. The indication of an address as being the default one should be done by calculation /conditional formatting.
April 30, 201213 yr I made a little demo of the unique checkbox in a portal idea a couple of years ago: https://pauseonerror.pbworks.com/w/page/14902759/Tips%20and%20Tricks The file is called UniqueCheckboxPortal (clever, eh?). It uses a script trigger and the script is completely portable.
May 1, 201213 yr Author Newbies Thank you all, especially mr_vodka, who showed me a great way to do this! If anyone is interested, see his method here: http://forums.filemaker.com/posts/92992696db?start=1&stop=10#192087 -F
Create an account or sign in to comment