Skip to main content
abdulrahimb9853
July 12, 2024
Solved

Sorting Records by Date and Priority

  • July 12, 2024
  • 6 replies
  • 0 views

Hello,

I am currently working with a Grid-only view that includes sorting functionality. My goal is to sort records first by "Received Date" and then by "Priority" (High, Medium, Low). However, my "Received Date" is stored as a "Date and Time" data type, which makes sorting by date challenging because the time component (hours, minutes, seconds) is unique and affects the sorting.

I would like to sort the records primarily by date and then by priority. To achieve this, I need to convert the "Date and Time" field to a "Date Only" format so that records with the same date can be sorted by priority. I attempted to use toDate() directly on the record type, but conversion cannot be applied directly. I also tried toUniformString(todate()), but it resulted in null values and caused issues with the UI. I don't want to change from the record type, and reset it to date only.

Could you please provide guidance on how to address this issue? Any assistance or suggestions would be greatly appreciated.

Thank you!




Best answer by stefanhelzle0001

Using custom record fields, you can extract the pure date from the datetime.

6 replies

July 13, 2024

Add secondarySorts on dateReceived and priorityId

abdulrahimb9853
July 15, 2024


This does not help the case. I need to ensure that the user does not sort it. I mean, it is for the initial sort when the end user sees the current interface. The secondary sort will happen when the user clicks the column instead. Anyway thanks for the suggestions.

April 3, 2026

I wanted to initially show high priority cases at the top.Im using a!! recorddata

stefanhelzle0001
July 13, 2024

Using custom record fields, you can extract the pure date from the datetime.

abdulrahimb9853
July 15, 2024


Yes, this is a better way. Thanks a lot. I can extract the date and use it for the initial sorting without worry now.