- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 06:55 AM
I created a choice list on a variable on a record producer and now I want to reuse that choice list on another variable. How can I do that?
I tried to do 'Lookup select box' and point to the question_choice table. This gives the correct list, but the order is not correct. So how should I be able to order them like the original as well?
It seems that the ORDERBY statement does not work in reference qualifiers either...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 07:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 07:07 AM
Hi Peter,
Try writing some client side script gliding towards question_choice table.Through script order by works fine
Regards
Anantha Gowraram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 07:13 AM
Hi Anantha,
Please note orderby does not work in client side codes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 07:17 AM
Hi Peter,
You can write a script include unchecking the client box, and gliderecord question_choice table with right queries and then you can use OrderBy(); function . Once you get results in the while(next()) loop, simply push it into a array.
Finally return the array.
Can you try that please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2017 07:18 AM
Hi Sharique,
Orderby works in client side when we use gliderecord
@peter here is sample code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var gr = new GlideRecord("incident");
gr.addQuery("assigned_to", newValue);
gr.orderByDesc("sys_created_on");
//gr.orderBy("sys_created_on");
gr.query();
if (gr.next()) {
g_form.setValue("parent", gr.sys_id);
}
}
Regards
Anantha Gowraram