laptop and a wrench

不具合

In ArcGIS Maps SDK for .NET, synchronizing an edited feature with a related record from client A's device that was previously deleted & synced from client B's device will upload the feature from client A but the related record is missing.

ArcGIS Maps SDK for .NET
不具合 ID 番号 BUG-000172341
送信されましたNovember 15, 2024
最終更新日February 2, 2025
適用対象ArcGIS Maps SDK for .NET
見つかったバージョン200.5
オペレーティング システムWindows OS
オペレーティング システムのバージョン10.0 64 Bit
ステータスIn Review

対処法

To counteract the potential missing related record from Client B's sync,

  1. Perform a query on the related table to obtain the related records from the mobile geodatabase.
  2. Take the related record(s) to re-update the related table. Because deleting a feature from client A removes its related records, the app needs to re-update the related table before performing client B's sync.
  3. Next, relate the selected feature from the primary table to the related feature(s) from the query result (step 1) using the RelateFeature method to ensure that both records stay related as emphasized in the documentation link: https://developers.arcgis.com/net/edit-features/relate-features/#relate-two-features
  4. After Client B performs a sync, both the primary feature and its related record appeared in the attribute table. Additionally, the created_user field name remains unchanged from the initial edit session while the last_edited_user field name reflects the correct value from Client B.

Although the code snippet below is not a complete algorithm to copy-paste, part of the code can be used in a test app.

-----Code Snippet-----

ArcGISFeatureTable relatedTable = null;

GeodatabaseFeatureTable featureTable = null;

FeatureQueryResult result = null;

Geodatabase _resultGdb = await Geodatabase.OpenAsync(_gdbPath);

// Loading primary feature table and related table

foreach (GeodatabaseFeatureTable table in _resultGdb.GeodatabaseFeatureTables)

{

await table.LoadAsync();

if(table.LoadStatus == LoadStatus.Loaded)

{

if (table.GeometryType == GeometryType.Point)

{

featureTable = table;

}

else if (!table.HasGeometry)

{

ArcGISFeatureTable relatedTable relatedTable = table;

await relatedTable.LoadAsync();

}

}

}

QueryParameters queryParams = new QueryParameters

{

Geometry = selectionEnvelope,

MaxFeatures = 1

};

// Selecting feature to obtain attribute data

result = await layer.SelectFeaturesAsync(queryParams, Esri.ArcGISRuntime.Mapping.SelectionMode.New);

Feature feature = result.First();

feature.SetAttributeValue(AttributeLabelFieldInput.Text, AttributeLabelFieldValue.Text);

// Primary attribute field name shares the same attribute data/value with the related record

var relatedFieldValue = feature.GetAttributeValue("PrimaryAttributeFieldName");

// Perform a query on the related table using the field name and value in the where clause

var query = new QueryParameters()

{

WhereClause = $"RelatedFieldName = '{relatedFieldValue}'"

};

// Query result from the related table is used to re-update the related table

// Query result is also used to relate the feature from the primary feature table to the feature from the related table

// Primary feature table is then updated before performing a sync

FeatureQueryResult relatedFeatures = await relatedTable.QueryFeaturesAsync(query);

if (relatedFeatures != null)

{

ArcGISFeature arcGISFeature = (ArcGISFeature)feature;

foreach (ArcGISFeature relatedFeature in relatedFeatures)

{

await relatedTable.UpdateFeatureAsync(relatedFeature);

arcGISFeature.RelateFeature(relatedFeature);

}

await featureTable.UpdateFeatureAsync(arcGISFeature);

}

再現の手順

不具合 ID: BUG-000172341

ソフトウェア:

  • ArcGIS Maps SDK for .NET

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動