Slush bucket - stop removing items from right bucket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 08:35 PM
Hi ..I am new to service now. I have a requirement where i need to stop moving items from Right bucket of a slush bucket when a check box is clicked.I tried out many possible ways. but no solution.Please help on this.
Riyaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 08:43 PM
I have check box and a slush bucket.
on clicking the check box, I should make sure no items from the right bucket of the slush bucket gets removed
when the check box is unchecked,I should be able to remove items from the right bucket.
Tried many options but didnt work.Any suggestions please.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 09:15 PM
Something like this should work in an 'onChange' catalog client script. Just add it to your client script and change 'test' to the name of your variable.
if(newValue == true){
//Disable the right-side of the slushbucket for the 'test' variable
$('test_select_1').disabled = true;
}
else{
//Enable the right-side of the slushbucket for the 'test' variable
$('test_select_1').disabled = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2015 10:04 PM
Thanks mark.. The code you showed disables the right bucket completely . Can I make only few options of the rightbucket gets transferred to left bucket where as the remaining options remains on the right bucket
Sent from my iPhone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 12:59 AM
Hi Riyaz,
Here is the code to move right bucket to left bucket.
function clearright ()
{
//this function clears the right slushbucket of var1
var varname = 'your variablename';
sourceOptions = gel(varname + '_select_1').options;
var selectedIds = new Array();
for (var i = 0; i < sourceOptions.length; i++)
{
try
{
if(sourceOptions[i].value.toString() == '12433454df3434df' || sourceOptions[i].value.toString() == '56565gfh4565657')
{
selectedIds.push(i); // Here we are pushing the position of the choice which ever i would like to move
}
}
catch(e)
{
alert(e.message);
}
}
moveSelectedOptions(selectedIds, gel(varname + '_select_1'), gel(varname + '_select_0'), '--None--'); //This function can move from right to left
sortSelect(gel(varname + '_select_0'));
}
For your more information Here Mark Stanger Provided document click below link to open that.
http://www.servicenowguru.com/scripting/client-scripts-scripting/move-list-collector-options/
Regards,
Harish.