Scoped GlideRecord - orderByDesc(String name)

Specifies a decending orderBy column.

Table 1. Parameters
Name Type Description
name String The column name to be used to order the records in a GlideRecord object.
Table 2. Returns
Type Description
void
var queryString = "priority=2"; 
var gr = new GlideRecord('incident'); 
gr.orderByDesc('short_description'); //Descending Order
gr.addEncodedQuery(queryString); 
gr.query(); 
while (gr.next()) { 
    gs.info(gr.short_description); 
}

Output: