Source of bug was that it was trying to sort on the column rosStatuses, but for Moh/SU, the query is different, it uses a view that had to have a different column name because it can only be lowercase name. First I changed it to just look at the right column in the code block that deals specifically with the sorting, but then I decided to move it up into the context/variable definition as that should also avoid future bugs and be less complex.
Ticket: https://freshworks.atlassian.net/browse/HCAP-1323
Source of bug was that it was trying to sort on the column rosStatuses, but for Moh/SU, the query is different, it uses a view that had to have a different column name because it can only be lowercase name. First I changed it to just look at the right column in the code block that deals specifically with the sorting, but then I decided to move it up into the context/variable definition as that should also avoid future bugs and be less complex.