populate values in Slushbucket on UI Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 03:01 AM
Hi,
I have a slushbucket in UI Page where it populates the assets. Below is the code. its not working. Can someone tell me whats the wrong.
<g:ui_slushbucket></g:ui_slushbucket>
<script>
slush.clear();
var preMadeAssets = new GlideRecord('alm_asset');
preMadeAssets.addQuery('purchase_line', '715dda0d911902c0d850d103a7472fef');
preMadeAssets.addQuery('install_status', 2);
preMadeAssets.query();
while (preMadeAssets.next()) {
slush.addLeftChoice(preMadeAssets.sys_id,preMadeAssets.asset_tag);
}
</script>
Regards,
Hima Pallela.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 03:38 AM
This example, will fill list of users in left side of slush bucket. Change your table name and columns.
<g:evaluate jelly="true">
var preMadeAssets = new GlideRecord('sys_user');
preMadeAssets.query();
</g:evaluate>
<g:ui_slushbucket name="sb" left_header="Left Side" right_header="Right Side">
<j:while test="${preMadeAssets.next()}">
<option value="${preMadeAssets.sys_id}"> ${preMadeAssets.name} </option>
</j:while>
</g:ui_slushbucket>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 04:14 AM
Hi Ram,
Now i can able to populate the data in multiple buckets. But other problem is that i'm not able to select the data from 2nd slush bucket onward.
Any help is appreciated.
Regards,
Hima Pallela.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 11:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 04:33 AM
Hi Hima,
This is a very old thread which I came across, you may have resolved it already but in reference to better community practice, I am posting this answer.
As mentioned by you, the final issue which we are looking at is not able to select from left bucket if there are multiple slush buckets on the same page.
The solution to that is very simple:
The ID/name for each slush bucket should be unique just for example:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate jelly="true">
var preMadeAssets = new GlideRecord('sys_user');
preMadeAssets.query();
</g:evaluate>
<g:ui_slushbucket name="sb" left_header="Left Side" right_header="Right Side">
<j:while test="${preMadeAssets.next()}">
<option value="${preMadeAssets.sys_id}"> ${preMadeAssets.name} </option>
</j:while>
</g:ui_slushbucket>
<g:evaluate jelly="true">
var preMadeAssets1 = new GlideRecord('sys_user');
preMadeAssets1.query();
</g:evaluate>
<g:ui_slushbucket name="sb1" left_header="Left Side1" right_header="Right Side1">
<j:while test="${preMadeAsset1s.next()}">
<option value="${preMadeAssets1.sys_id}"> ${preMadeAssets1.name} </option>
</j:while>
</g:ui_slushbucket>
</j:jelly>
having the names to be sb and sb1 and so on will do the trick.
Mark this as correct or helpful if it is. 🙂
Thanks,
Vidyasagar