How to OrderBy Sequence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 12:54 AM
Hi All,
How can we show the records based upon the sequence of choice list field.
I have a choice list field on Outage table and based upon the sequence of the choices I need to show outage records.
Inshort I need to OrderBy the sequence of Choices.
How can I acheive it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 12:59 AM
Hi,
read this topic discussion thread, it will help you to do it:
Hope this will be useful for you.
Please, remember to mark Correct or Helpful if you find my response useful.
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 01:17 AM
Thank you I need to make changes on the server side script of the widget above link is related to client script.
Any Ideas How to order by Sequence rightnow I am using the below script to get the sequence of the choices but my only problem is to show Outage table records based upon this sequence.
var seq = new GlideRecord('sys_choice');
seq.addEncodedQuery('nameLIKEoutage^elementLIKEtype');
seq.orderBy('sequence');
seq.query();
while(seq.next()){
gs.print( 'Element:'+seq.value+' :: Sequence'+seq.sequence);
}