Error
Número de ID del error | BUG-000172341 |
---|---|
Enviado | November 15, 2024 |
Última modificación | February 2, 2025 |
Relacionado con | ArcGIS Maps SDK for .NET |
Versión encontrada | 200.5 |
Sistema operativo | Windows OS |
Versión de sistema operativo | 10.0 64 Bit |
Estado | In Review |
To counteract the potential missing related record from Client B's sync,
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 del error: BUG-000172341
Software:
Obtener ayuda de expertos en ArcGIS
Descargar la aplicación de soporte de Esri