- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 08:27 AM - edited 01-24-2023 09:01 AM
I have two variables in a catalog item. The first is a lookup select box. The other is a select box with two choices, User & Shared.
Once the user makes a selection, either User or Shared, I want the lookup select box to only show records who's "mailboxtype" (mailboxtype is a field in the table) matches the selection. I tried modifying the ref qualifier using g_form.getValue() to capture the users selection, but now it's not returning any records: mailboxtypeLIKEg_form.getValue("type_of_mailbox");
Here is an example of a record in the lookup select box table. The MailboxType is "Shared". Therefore, if the user selects "Shared" as the type on the catalog item, this record should appear in the list.
Catalog Item:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 09:49 AM - edited 01-24-2023 09:50 AM
I was able to achieve with the following ref qualifier: javascript:'mailboxtypeLIKE'+current.variables.type_of_mailbox;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 09:28 AM - edited 01-24-2023 09:30 AM
Here is what I would try:
Assume your Type of Mailbox variable's name is 'mailbox_type'
Create two mailbox list collector variables
- user_mailbox
- shared_mailbox
For these variables, configure them as follows:
Hidden = true
Under type specifications: your reference qualifier should be, for example, type=shared or type=user (whatever you would use to filter the table with the results you need)
Create a catalog client script:
Name: 'show list depending on value'
Type: onChange
Variable name: mailbox_type
Script:
**make sure to configure UI type on script properly
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
var device = g_form.getValue('mailbox_type');
if (device == 'shared') {
g_form.setVisible('shared_mailbox', true);
g_form.setMandatory('shared_mailbox', true);
} else {
g_form.setVisible('shared_mailbox', false);
g_form.setMandatory('shared_mailbox', false);
}
if (device == 'user') {
g_form.setVisible('user_mailbox', true);
g_form.setMandatory('user_mailbox', true);
} else {
g_form.setVisible('user_mailbox', false);
g_form.setMandatory('user_mailbox', false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 09:49 AM - edited 01-24-2023 09:50 AM
I was able to achieve with the following ref qualifier: javascript:'mailboxtypeLIKE'+current.variables.type_of_mailbox;