GlideRecord query on employee center favorite remote table does not return properly sorted results when orderBy is used with chooseWindowDescriptionGlideRecord query on employee center favorite remote table (sn_ex_sp_st_favorite) does not return properly sorted results when orderBy() is used with chooseWindow() method.In the query result, a few records are omitted which would come before the result records when sorted with the columns provided in orderBy method.Steps to Reproduce 1. As an admin mark 20 items as favorite.2. Run the following background script var favorites = new GlideRecord('sn_ex_sp_st_favorite');favorites.orderBy("primary_display");favorites.chooseWindow(0,10);favorites.query();while(favorites.next()) {gs.info(favorites.getDisplayValue("primary_display"));}3. Observe the results. 4. Remove the chooseWindow from the script from step 2 and run it. 5. Now you would have all 20 favorites sorted by 'primary_display' column, observe the first ten records. Expected outcome: First ten records returned at step 5 should match with the ten records returned at step 3. Actual outcome: Some records were omitted at step no. 3, it does not show the correct list of first ten records sorted by 'primary_display'.Workaround'sn_ex_sp_st_favorite' is a remote table which internally brings data from 'sp_favorite' table, primary_display and other columns are not present at 'sp_favorite' table that's why the 'order by' is not working as expected.To achieve sorting on the remote table column(e.g. primary_display), remove 'chooseWindow' from gliderecord query, this would bring all the favorites sorted by 'order by' columns then iterate over these records to get the records in a window you are interested in.Related Problem: PRB1661097