October 21, 200817 yr Is there any easy way to do this that I'm just not aware of? I have a value list ("All Departments") populated by values in the field "Department" stored within the table "Users". In the "Hardware" table (which has a relationship to "Users") there's a text field "DeptFilter" that's global, set to display as a checkbox set using "All Departments". When the user clicks a "Find" button they're presented with a simple layout showing the "DeptFilter" field as an assortment of checkboxes. In theory, they select one or more checkboxes and click OK which then triggers the script to show only those hardware records tied to the selected department. Selecting a SINGLE department works fine; selecting multiple departments breaks. How does one script a search like this? Edited October 21, 200817 yr by Guest
October 21, 200817 yr The DeptFilter field in Hardware is global? That doesn't sound right. If it's checkboxes though, then a given hardware record can have multiple values in DeptFilter, yes? It might be easier to set up a self-relationship using DeptFilter and script a GTRR (go to related records) rather than a Find.
October 21, 200817 yr GTRR (or even a portal) is the easy way. To do this by finding, you need to have your script loop and create a separate request for each value in DeptFilter.
October 22, 200817 yr Author Makes sense. How do you separate the values within the field? When I duplicated the field and changed the duplicate to an edit box, I see that each selected item within the checkbox list becomes its own line of text in the edit box. Presumably there's a way to count the number of lines and extract each separate line to perform the separate requests?
October 22, 200817 yr The beauty of the GTRR approach is that you don't need to break out the separate lines: it "just works."
October 22, 200817 yr If you want to pursue the Find route, take a look at the ValueCount and GetValue functions.
October 22, 200817 yr ValueCount() will do the count. You can get the correct value simply by using GetValue() in conjunction with the request number, and exit the loop when the number of requests reaches the count. I am sure I have posted a demo of this at some time, but I have too many posts and too little time to look for it now.
October 22, 200817 yr Author I think I found it, thanks. And I also think I'll try the GTRR approach first. :
Create an account or sign in to comment