Gliderecord order sequence matter?

dgarad
Giga Sage

Hi Team,

While we move orderByDesc to below the orderBy we are getting correct data. However, with the given screenshot, we did not get the correct data so, does this sequence of orderBy matter? if yes, can anyone provide me with some references?

dgarad_0-1719055556186.png

 

 

 

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad
3 REPLIES 3

Community Alums
Not applicable

Hi @dgarad ,

Yes it does matter !! You need to use tow function

1.   orderBy

after it you should use.

2. orderByDesc

Example :

var gr = new GlideRecord('incident');
gr.addQuery('active', true);
gr.orderBy('category');
gr.orderByDesc('sys_created_on');
gr.query();

 

 

Hi @Community Alums 

do you have any references?

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Community Alums
Not applicable

Hi @dgarad ,

I have given you the sample script on the above answer.