LS
Can anyone show me what would be the proper way to restrict the values in a dropdownbox attached to a dynamic list. I have a dynamic list but depending on values in a config table some values must not be shown in the dropdown.
list: 1,2,3 and 4
in the config it says that (this user) may only see 1 and 3.
Regards, Harry
restricting values of dropdown attached to dynamic lists
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 118
- Joined: Tue Oct 23, 2012 7:01 am
- Location: The Netherlands
- jig
- Ebase User
- Posts: 30
- Joined: Sun Oct 09, 2011 10:16 am
- Location: UK
Hi Harry,
If the list is build from a database table, I would recommend a dynamic WHERE clause using '&&QUERY' principle.
Then at runtime, you can substitute the '&&QUERY' with something like USER_ID='Ben' so that the SQL looks like...
Select * from TABLE1 WHERE USER_ID='Ben'
Hope this helps!
Regards
Jignesh
If the list is build from a database table, I would recommend a dynamic WHERE clause using '&&QUERY' principle.
Then at runtime, you can substitute the '&&QUERY' with something like USER_ID='Ben' so that the SQL looks like...
Select * from TABLE1 WHERE USER_ID='Ben'
Hope this helps!
Regards
Jignesh
0 x
Regards,
Jignesh
Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com
Jignesh
Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Topic moved to Application Development forum.
You can restrict list entries by creating a custom list from the dynamic list and only adding those entries you want to. Here is an example that takes out all list entries beginning with "B".
You should also set the "When list is built" property to "Never" for the form field. This stops the system building the list automatically - it's now going to be built only when you invoke the buildList() method. This approach works fine if you just want to build the list once. But it won't work if you need to build the dynamic list more than once - this is because the dynamic list has been replaced with the custom list and the build will fail second time around.
You can restrict list entries by creating a custom list from the dynamic list and only adding those entries you want to. Here is an example that takes out all list entries beginning with "B".
Code: Select all
// First build the dynamic list
fields.MYFIELD.list.buildList();
// Now get the list values
var dynamicListValues = fields.MYFIELD.list.getDisplayValues(false);
// Create a custom list and attach it to the field
var customList = fields.MYFIELD.createCustomList();
// Loop through the dynamic list entries and take out those we don't want
for each (var entry in dynamicListValues)
{
if (entry.charAt(0) != "B")
{
customList.add(entry);
}
}
0 x
Who is online
Users browsing this forum: No registered users and 17 guests