- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Everyone,
I have one requirement.
Requirement is In Catalog form having the Requestor For field (reference type--user table) and Application filed(reference type- App table) .If i select Minipay in Application then i am able to select multiple users in Requestor For field. This requirement only for Minipay option .suppose if i select another application then i am able to select single user at time in Requestor For field.
Please provide solution to this one.
Thanks,
Manohararuna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The Requested For variable in a catalog item is a reference type (to sys_user). Out-of-the-box, reference variables only allow one value. To allow multiple selections, you need to use a Lookup Select Box / Multi-row variable set / Glide List.
So the trick is:
You actually need two different variables:
requested_for_single → type = Reference (sys_user), for normal use.
requested_for_multi → type = Lookup Select Box (or Glide List), for Minipay.
Then use a Catalog Client Script (onChange of Application) to show/hide the right one.
Example Client Script
Type: Catalog Client Script
Applies to: Item
When: onChange → Application
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// If Application = Minipay
if (g_form.getDisplayBox('application').value == 'Minipay') {
g_form.setDisplay('requested_for_multi', true);
g_form.setMandatory('requested_for_multi', true);
g_form.setDisplay('requested_for_single', false);
g_form.setMandatory('requested_for_single', false);
g_form.clearValue('requested_for_single');
} else {
g_form.setDisplay('requested_for_single', true);
g_form.setMandatory('requested_for_single', true);
g_form.setDisplay('requested_for_multi', false);
g_form.setMandatory('requested_for_multi', false);
g_form.clearValue('requested_for_multi');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Create Reference variable for single selection.
Create List Collector for multiple selection.
Control visibility via Client Script.
Only one will be shown at a time depending on Application selection.
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Create Reference variable for single selection.
Create List Collector for multiple selection.
Control visibility via Client Script.
Only one will be shown at a time depending on Application selection.
Shashank Jain