sort featureset on field of type esriFieldTypeDate
Hello,
I am trying to sort a featureset within a workflow on a field that is of the type esriFieldTypeDate in the published service so that the results panel will display the open dispatch call in desending order by a date/time (time is critical).
I am using the Sort FeatureSet activity. I can get this activity to work for a text field, but I cannot get it to work for a date field (E911-dispatch call dates) that is of type esriFieldTypeDate.
Anyone know what to do with this?
Thanks,
Carmen
0
-
If the source of the featureset is a Query Task activity, what are the results if you sort there with the Order By Fields parameter? 0 -
Well, I saw that but couldn't figure out exactly what to use since it needed a List.
So, I went back to the Sort Featureset activity because I knew I was populating the parameters correctly. It works for other text fields, just not this date field.
Carmen0 -
I have a lot of problems with geocortex and date fields.
Firstly, are all your date fields in the correct format?
Could you perhaps copy your date field to a text field to get it to work that way? I have a feature service that has a date field that is sortable in the results in the viewer, without having to use an activity, though the user has to select this themselves0 -
Hi Carmen,
I did a quick test using the Date_Time field on https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/0 and SortFeatureSet seemed to work as expected. I did notice 2 things that could trip up though-- If the date field isn't included on the Out Fields property in the query task, the sorting won't work (but you won't get any error)
- The Sort Attribute property in the SortFeatureSet activity is case sensitive. If you don't get the casing right, the sorting won't work (but you won't get any error)
-Amanda0 -
Thank you all. Based on what you were telling me, it sounded as though what I was using *should have* worked.
What ultimately worked...
Option 1) For the "Order By Fields" option in the Query Task, I somehow missed the option to use this when setting the parameter:
New System.Collections.Generic.List(Of ESRI.ArcGIS.Client.Tasks.OrderByField)({ New ESRI.ArcGIS.Client.Tasks.OrderByField("Field", ESRI.ArcGIS.Client.Tasks.SortOrder.Ascending) })
and replaced the Field with my date field. This worked perfectly
Option 2) the SortFeatureSet activity. Per Amanda, this should work. So, I tried only sorting with this activity again. I changed nothing from the other day. Just saved and re-started the application. What never seemed to work the other day works today. I have no idea why. I'll blame it on the proxy server, the cache, or web gremlins. (This is our reasoning when things like this happen).
Yes, I have had issues with dates especially with the Cityworks extension so I was wondering if I was hitting something similar.
Thanks again,
Carmen0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
5 kommentarer