Select to view content in your preferred language

Auto Increment fields on mobile device

722
2
01-18-2013 06:56 AM
KiahWarren
Emerging Contributor
I am trying to get a sample ID field in a soils sample feature class to automatically auto increment once a geologist enters the first point into the dataset. I tried putting a python script in the field calculator for that field before I turned the .mxd file into a project file but that does not seem to translate over to the project. I know ArcPad found a way around the auto-increment issue. Does anyone know of any tricks for ArcGIS for mobile 3.1?
0 Kudos
2 Replies
AkhilParujanwala
Regular Contributor
Hi,

Yes this should be possible with custom coding on the ArcGIS Mobile side, this may not be possible to be done on the server side using a python script.

I personally use the old 10.0 apk for now.

Here's basically how to do it.

- When the user collects a feature to the following below
- Get the MapLayer that you are working with
- Get the FeatureLayer in the map
- Loop through the Read the entire data table
- Look at the SampleID field
- Find the last number, and add one
- Keep that number and store it into the new feature that the user will collect.

So yes I do believe this is possible, just need to read the data table of the entire layer and save the value into the new feature's SampleID field.

This is roughly what you need to do, I hope this helps.
0 Kudos
KiahWarren
Emerging Contributor
Thanks for your Reply Akhil,

I had to shelve this project for a while. I have recently started it up again, and so far have not even reached the customization part. If I manage to get this working I will be sure to post here for others as well. Otherwise, if anyone solves this problem first or has any tips on working with customizing extensions in SDK 3.1 they would be greatly appreciated.
0 Kudos