Select to view content in your preferred language

Issue setting default values on a merged feature using an Inspector object.

283
2
Jump to solution
a month ago
MRJ1
by
Emerging Contributor

Hello. I have encountered an anomaly while using an Inspector object to set attribute values for merged polyline features. I am using the Merge(Layer,IEnumerable<Int64>,Inspector) method as part my edit operation. 

The feature table I'm working with has fields that are not null, domains applied, and default values set. When assigning attribute values for the merged feature using the Inspector, I have noticed that if I assign the default value for the field, the value will not be applied and I get a field validation error because the value must not be left null. If I don't assign a value at all for the field, the default value is still not applied. If I assign any other value listed in the domain that is not the default value, the attribute value is successfully applied.

In searching for similar forum posts, I found this. It follows a somewhat similar pattern, but when working with feature templates:

https://community.esri.com/t5/arcgis-pro-questions/null-value-set-on-feature-template-with-default/t...

I am using version 3.4 of the SDK and do not recall having this issue with previous versions. Thanks for your time!

0 Kudos
1 Solution

Accepted Solutions
NarelleChedzey
Esri Contributor

Hello, 

We found a similar issue within our Pro 3.5 development cycle where the EditOperation.Create(Layer, Inspector) created rows with null values instead of the default values with fields that have domains attached.  It sounds very much like the issue you are seeing. 

We fixed this issue within 3.5 which was released a few days ago.   Are you able to upgrade to Pro 3.5 to see if your issue is resolved?

 

If you are not able to upgrade, then would adding a Modify after the Merge (within the same EditOperation) be a workaround.  Make sure that you specify EditOperation.ExecuteMode = ExecuteModeType.Sequential prior to the Merge and Modify calls.   I would suggest using the version of the Modify that takes a dictionary of attributes - https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9530.html 

Thanks

Narelle

View solution in original post

0 Kudos
2 Replies
NarelleChedzey
Esri Contributor

Hello, 

We found a similar issue within our Pro 3.5 development cycle where the EditOperation.Create(Layer, Inspector) created rows with null values instead of the default values with fields that have domains attached.  It sounds very much like the issue you are seeing. 

We fixed this issue within 3.5 which was released a few days ago.   Are you able to upgrade to Pro 3.5 to see if your issue is resolved?

 

If you are not able to upgrade, then would adding a Modify after the Merge (within the same EditOperation) be a workaround.  Make sure that you specify EditOperation.ExecuteMode = ExecuteModeType.Sequential prior to the Merge and Modify calls.   I would suggest using the version of the Modify that takes a dictionary of attributes - https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9530.html 

Thanks

Narelle

0 Kudos
MRJ1
by
Emerging Contributor

Thank you! I can confirm that this issue appears to be resolved now after upgrading to Pro 3.5. 

0 Kudos