So some quick background -
We have a module called 'Client Meetings' where there is a custom DateTime field where the sales rep inputs the date that client was met.
We have a function takes in a Client's ID, then fetches all records in the 'Client Meetings' module tied to that client.
What I do is then the following:
- response = zoho.crm.getRelatedRecords("Client_Meetings","Clients",ClientId);
- list_of_meeting_dates = { }
- for each meeting in response
- {
- list_of_meeting_dates.add(meeting.getJson("DateTime_of_Meeting"));
- }
- sorted_list = list_of_meeting_dates.sort(false)
- latest_date = sorted_list.get(0)
Basically, I sort the list in descending order, then fetch the first entry.
However this doesn't quite seem to work, because the date "2020-01-17T23:00:00+08:00" appears before the date "2020-01-22T23:00:00+08:00", which it shouldn't.
I'm looking for an elegant solution to solve this issue, as well as general best-practice advice with regard to sorting different field types using Deluge.