Select to view content in your preferred language

How to create proper RowHandle from a Row?

156
1
08-08-2024 01:44 AM
HUK71
by
New Contributor

Hi there,

I got a little bit puzzled, when I tried to use EditOperation.Delete(RelationshipDescription) from the SDK. There's a constructor, that requires you to insert "RowHandle" instances for origin and destination, I got two proper Row Instances and called "new RowHandle(Row)" - But EditOperation.Delete(RelationshipDescription) run into an Error with "Nullable not set".

Turned out, that EditOperation.Delete(RelationshipDescription) is implemented using RelationshipDescription.OriginRow.ObjectID, and the given new RowHandle(Row) does not properly set this value:

    public long? ObjectID
    {
      get
      {
        long? objectId = this._objectID;
        if (objectId.HasValue)
          return objectId;
        return this._token?.ObjectID;
      }
    }

 

I assume this is a bug in the SDK. Using new RowHandle(..., long objectId) worked fine.

0 Kudos
1 Reply
NarelleChedzey
Esri Contributor

Hello, 

Thank you for reporting this.  Internally we also recently identified this same issue with the RowHandle object and how it is used within the EditOperation object.  The Create and Delete operations with regards to relationships is one of these scenarios where some gaps in functionality exist. 

As you mention if the RowHandle is defined using a MapMember and objectID pair then the EditOperation Delete relationship method will work correctly.  Unfortunately it will not work if the rowHandle is defined using a Row (or with a Table/FeatureClass and objectID pair). 

These bugs have been fixed and will be available in the 3.4 release of the software. 

Sorry for any inconvenience.

Narelle