- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 01:04 AM
Hi All,
I have a variable of reference field type with simple condition in it.
I need to sort the results by a column in descending order.
I used variable attributes section where ref_ac_order_by=columnname.
This is doing ascending order sorting.
How to do it descending order sorting by a column name?
I have referred many community links and also got to know , have to write query business rule. But I am not happy with that.
Kindly advise using variable attributes sorting by descending or a better way.
Thanks,
Ram Prakash K R
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2020 04:39 AM
Can you try like this
var encodedquery = "sys_created_on>=2020-12-14^sys_created_on<=2020-12-15 23:59:59";
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 02:45 AM
Hi,
Remove everything from Variable Attributes & Reference Qual in your Reference Variable and Write this code in an Onload Client Script.
var vname = "<your reference variable name>";
var encodedquery = <pur your encoded query here>; //Ex: u_active=true
try {
var ls = g_list.get(vname);
ls.reset();
ls.setQuery(encodedquery + '^ORDERBYDESC<yourfieldnamehere>');
} catch (e) {
window[vname +'g_filter'].reset();
window[vname + 'g_filter'].setQuery(encodedquery + '^ORDERBYDESC<yourfieldnamehere>');
window[vname + 'acRequest'](null);
}
Please mark it as correct answer if it solves your issue.
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 03:07 AM
Hi Narsing,
I tried the above script but the result is not correct.
Thanks,
Ram Prakash K R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 03:21 AM
Hi,
Is it possible to share screen shot of code and the variable as well. I just tried and it is working for me.
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 10:07 PM
Hi Narsing,
I written the code onLoad() of the catalog item?
Is it correct?
Thanks,
Ram Prakash K R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2020 10:21 PM
