Hoppa till huvudinnehållet

sort featureset on field of type esriFieldTypeDate

Kommentarer

5 kommentarer

  • Nico Burgerhart
    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
  • Carmen Durham
    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.

     

    Carmen

     

     

     
    0
  • Permanently deleted user
    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 themselves
    0
  • Permanently deleted user
    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)
    I'd double check those, then maybe check if the issue is particular to your service or environment (see if the test service I used works ok on your end).

     

    -Amanda
    0
  • Carmen Durham
    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,

     

    Carmen

     

     

     
    0

Du måste logga in om du vill lämna en kommentar.