Steve G Posted October 21, 2008 Posted October 21, 2008 (edited) 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, 2008 by Guest
Fitch Posted October 21, 2008 Posted October 21, 2008 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.
comment Posted October 21, 2008 Posted October 21, 2008 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.
Steve G Posted October 22, 2008 Author Posted October 22, 2008 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?
Fitch Posted October 22, 2008 Posted October 22, 2008 The beauty of the GTRR approach is that you don't need to break out the separate lines: it "just works."
Fitch Posted October 22, 2008 Posted October 22, 2008 If you want to pursue the Find route, take a look at the ValueCount and GetValue functions.
comment Posted October 22, 2008 Posted October 22, 2008 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.
Steve G Posted October 22, 2008 Author Posted October 22, 2008 I think I found it, thanks. And I also think I'll try the GTRR approach first. :
Recommended Posts
This topic is 5876 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