I rearranged my field order in my MXD and when I published as a service to ArcGIS server, I noticed that the MapService recognizes the new field order but the feature service does not. Is this the correct behavior? Is there a way to change Field Order for a FeatureService?
Although a 3 years old thread, no solution to the bug yet. Here is the link to the bug NIM090535: When the layer order changes in the map service, fea..
This idea is under consideration as mentioned in the thread linked by Kuba Szostak.
I would recommend considering use of the Feature Class to Feature Class tool. This contains a Field Map in which you can reorder your fields. When you re-order your fields in ArcMap or in ArcGIS Pro you're just temporarily changing them for viewing usage. To make the re-ordering permanent, export to a new file. Then you should see your changes carry through when publishing.
Hopefully that helps!
I'm working with set of feature classes on professional geodatabase with all sweets from ESRI like versioning and archiving enabled on it. Using Feature Class to Feature Class would erase all historical data and working version, so it's not an option for me.
Why feature service cannot keep field order from MXD like map service is already doing?
Without this my web application could't use field order directly from feature service like the same way it is using field visibility or field read-only state. So I have to hard-code field order in my application instead of leave this for our GIS professionals.
Hello Kuba and Henry,
After a bit more digging, it looks like you're running into something we already have listed as a known bug:
[BUG-000090535: Feature Service Fields List Order is not maintained on REST endpoint.]
I would recommend giving us a call and creating a support case so we can get you attached to the bug, letting Development know that another user is affected by this issue. The bug is marked as In Product Plan, so it seems Development is working on it!
The workaround would be the Feature Class to Feature Class tool as suggested before, but I know that may not be ideal. Please give us a call so we can get you linked onto the bug!