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.
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?
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.
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.
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.