fchieli Posted November 11, 2007 Share Posted November 11, 2007 Hi, I'm trying to find the most elegant way to give to users the option of tagging (select) a bunch of records. For instance, let's say we have a list of several contacts and we want to isolate a few that need to be printed. The most obvious way is to include a check box on every record, have the user checking the box on the desired contacts and then do a find for checked contacts. This works great on a standalone solution, but if the solution is hosted on a server there's now a problem: User A marks his selected 4 contacts, a few seconds later User B selects a set of 5 different contacts. When user A issues the find command , he's going to find his 4 contacts + the 5 contacts of user B... Has anyone seen a good way to solve this type of problems on hosted solutions? Thanks on advance for your suggestions! Federico Link to comment Share on other sites More sharing options...
comment Posted November 11, 2007 Share Posted November 11, 2007 Put the unique IDs of selected records in a global text field, as a return-separated list. You can still use a checkbox, but only as a visual indicator. The checkbox itself would be a defined as a button, attached to a script that adds/removes the record's unique ID to/from the list. To quickly isolate the selected records, define a relationship to a new occurrence of the table, matching the global field to the unique ID. Then use Go to Related Record[] to create a found set. Alternatively, you could use a 'real' (i.e. not global) field in a user table, where each user has a record. This takes more work to set up, but it enables keeping the user's selection between sessions. Link to comment Share on other sites More sharing options...
fchieli Posted November 12, 2007 Author Share Posted November 12, 2007 Wow! brilliant!! Thanks so much. federico Link to comment Share on other sites More sharing options...
Søren Dyhr Posted November 12, 2007 Share Posted November 12, 2007 attached to a script that adds/removes the record's unique ID to/from the list Since you're on 9 Adv. could the attached script be boiled down to one single Set Field[ using this: http://www.briandunning.com/cf/39 I use this approach each time I have a situation like this, because it trims off double pilcrows, while if I were to make a script to behave similar, could I easily spend 10 minutes circumvent their likeliness to creep into the global. Well I might be able to find a script in another solution I could copy/paste over, but then must some editing happen afterwards. Here is it just thrown into the buttons def. no need to call a dedicated script - just tie a single command to it. --sd Link to comment Share on other sites More sharing options...
comment Posted November 12, 2007 Share Posted November 12, 2007 I manage without a custom function: Case ( IsEmpty ( FilterValues ( item ; list ) ) ; list & item & ¶ ; Let ( listXcl = Substitute ( ¶ & list & ¶ ; ¶ & item & ¶ ; ¶ ) ; MiddleValues ( listXcl ; 2 ; ValueCount ( listXcl ) - 2 ) ) ) Link to comment Share on other sites More sharing options...
Søren Dyhr Posted November 12, 2007 Share Posted November 12, 2007 Definitely better, why indeed overlay a custom function even recursive, which deals with list against list, when the context requires list against item ... you way of getting rid of outer pilcrows make me smile. I'm likely to change my behaviours - cheers! --sd Link to comment Share on other sites More sharing options...
comment Posted November 12, 2007 Share Posted November 12, 2007 Keep in mind that this version only works with lists that always have a trailing ¶. Link to comment Share on other sites More sharing options...
Søren Dyhr Posted November 14, 2007 Share Posted November 14, 2007 Keep in mind that this version only works with lists that always have a trailing ¶. Which means, as long as the invisible buttons in the portal are solely responsible for the setting of the field won't there be problems, but if other scripts are likely to do something in the vicinity of the single line task ... should we be carefull, perhaps even seek shelter under Ray's recursive CF instead? --sd Link to comment Share on other sites More sharing options...
comment Posted November 14, 2007 Share Posted November 14, 2007 I believe this modification should work when a list may or may not have a trailing ¶ ... listXcl = Substitute ( ¶ & list & ¶ ; [ ¶ & item & ¶ ; ¶ ] ; [ "¶¶" ; ¶ ] ) ; ] ; MiddleValues ( listXcl ; 2 ;ValueCount ( listXcl ) - 1 ) ) Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6135 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