Refresh an auto-incrementing attribute

735
1
11-02-2020 06:37 AM
BenShort
New Contributor

I am currently working on a solution that requires me to submit an inspection to a layer and this inspection may contain one or more defects that are added to a defect layer. The relationship between the two feature layers is already set up on the server.

Due to client restrictions, the latest version of the SDK I am able to use is 100.2.1

When an inspection is submitted, the field INSPECTION_ID is automatically populated with an auto-incrementing value. Since this value is set at the server side, I need to refresh the local copy to fetch this new value. The current version of the SDK includes a Refresh() method on the feature, however this isn't available and the closest I can find in 100.2.1 is the RefreshObjectId() method.

I have tried some alternatives such as LoadAsync() and RetryLoadAsync() but the inspection id attribute seems to remain null. If I lookup the record on the REST explorer in a browser then I can see an id has been generated.

I have also tried experimenting with the RelateFeature() method, but that doesn't seem to help at all either.

Is there an alternative way of being able to fetch all the updated attributes after creating a feature at all?

Tags (2)
0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor

Support for related features are (as you found) quite limited in the earlier releases. I realized you're constrained wrt moving up versions, but it might be worth pointing out to your client that 100.2.1 is in mature support at this point.

0 Kudos