Select to view content in your preferred language

Attribute value of Related feature is Incorrect

764
4
07-02-2018 05:47 AM
MuruganandhamKuppan1
Regular Contributor

I have created a related feature for a feature. I got the following error while trying to add the related feature to the related table.

error: OriginalFeatureID has an incorrect value. Encountered on feature with ID of -9223372036854775808.

here the code to relate the feature with the related feature

[relatedFeature relateToFeature: (AGSArcGISFeature*)data.originalFeature];

OriginalFeatureID's value is automatically assigned to the related feature attribute after calling relateToFeature: method

I have commented "relateToFeature" and added the OriginalFeatureID Manually at related feature creation, as

[NSNumber numberWithLongLong:123456];.  Same error occurs.

0 Kudos
4 Replies
Nicholas-Furness
Esri Regular Contributor

Was the feature you're relating to created and added in code (as opposed to being retrieved from a query)? If so, have you called refreshObjectID on it after the add completed?

MuruganandhamKuppan1
Regular Contributor

Hi Nick, yes. I called 'refreshObjectID' and can able to get the objectID of original feature. The value of ObjectID is assigned to "OriginalFeatureID" of related feature's attribute.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Thanks Muruganandham Kuppan‌,

The documentation here has some specific requirements for ensuring the relationship is written and committed properly.

If you're meeting those and are still seeing this issue, it might be best for you to open a support ticket. It's hard to tell from just the info provided above without more context, and support will be able to dig into that with you more.

0 Kudos
MuruganandhamKuppan1
Regular Contributor

Hi Nicholas Furness‌,

Here what i did,

before: (as in Github sample code),

relatedTable.createFeatureWithAttributes  ->  relatedFeature.relateToFeature  ->  relatedTable.addFeature

I don't have any idea why it was not working for me or in Objective-C. Its Strange.

after

relatedTable.createFeatureWithAttributes ->  relatedTable.addFeature  ->  relatedFeature.relateToFeature

Now the related feature is added to actual feature.

0 Kudos