Hi,
I have two tables both are ObjecClass (no geometry).
- TableA has relationship to TableB 1..n (BelongsTo (13) -- Related To: TableB (16))
If I try after opening and querying TableA to (ServiceFeatureTabke) QueryRelated from TableB I Get exception ({"Specified argument
was out of the range of valid values.\r\nParameter name: length"} ) :
* at Esri.ArcGISRuntime.Data.FieldInfo..ctor(String name, String alias, FieldType type, Nullable`1 length, Boolean editable, Boolean nullable, Domain domain)
at Esri.ArcGISRuntime.Tasks.Query.RelationshipResult.GetFieldsFromJsonDictionary(JsonDictionary jsonDictionary)
at Esri.ArcGISRuntime.Tasks.Query.RelationshipResult.FromJsonDictionary(JsonDictionary jsonDictionary, String tableName)
at Esri.ArcGISRuntime.Tasks.Query.QueryTask.<ExecuteRelationshipQueryInternal>d__2c.MoveNext()
I have tried change Thread currentculture to en-US no effect. Using 10.2.4 SDK.
Any clue ? workaround?
Solved! Go to Solution.
This looks like an issue we've seen with GUID fields in related tables that is slated to be fixed in the next version. I'm curious, if you perform your query using a QueryTask and filter out the 'TABLEA_GLOBALID' field if it will return successfully. Please try the following type of query with your data:
var relParam = new RelationshipParameters(new long[] { 1L }, 0L);
relParam.OutFields = new OutFields(new string[] { "AREANUMBER", "ARCHIVE", "GLOBALID" });
var queryTask = new QueryTask(new Uri(FeatureServiceUrl));
var result = await queryTask.ExecuteRelationshipQueryAsync(relParam);
-Greg
Are you working with ServiceFeatureTable? Would it be possible for you to share also the JSON response from the QueryRelatedAsync call? I believe this exception has something to do with parsing the Fields in the JSON and would happen only if Fields with type esriFieldTypeString is missing length property.
Thanks.
Jennifer
Hi,
I am unable to repro the problem you are seeing with Querying related rows between two tables. Would it be possible for you to share your data ?
Its working directly from Esri ArcGIS server service query site (Fiddler -> RAW)
If problem isn't those fields. I added all TableB fields to repro. Problem is related those added fields -> (AREANUMBER, ARCHIVE, GLOBALID, TABLEA_GLOBALID).
Here is JSON response (added all fields):
{
"fields": [
{
"name": "OBJECTID",
"alias": "OBJECTID",
"type": "esriFieldTypeOID"
},
{
"name": "AREANUMBER",
"alias": "AREANUMBER",
"type": "esriFieldTypeInteger"
},
{
"name": "ARCHIVE",
"alias": "ARCHIVE",
"type": "esriFieldTypeInteger"
},
{
"name": "GLOBALID",
"alias": "GLOBALID",
"type": "esriFieldTypeGlobalID",
"length": 38
},
{
"name": "TABLEA_GLOBALID",
"alias": "TABLEA_GLOBALID",
"type": "esriFieldTypeGUID",
"length": 38
},
{
"name": "CREATOR",
"alias": "Creator",
"type": "esriFieldTypeString",
"length": 20
},
{
"name": "CREATED",
"alias": "Created",
"type": "esriFieldTypeDate",
"length": 36
},
{
"name": "CHANGER",
"alias": "Changer",
"type": "esriFieldTypeString",
"length": 20
},
{
"name": "CHANGEDATE",
"alias": "Changedate",
"type": "esriFieldTypeDate",
"length": 36
}
],
"relatedRecordGroups": [
{
"objectId": 2262,
"relatedRecords": [
{
"attributes": {
"OBJECTID": 2999,
"AREANUMBER": 1,
"ARCHIVE": 0,
"GLOBALID": "{9830E5CE-3D79-4606-9B50-4912E3072EF2}",
"TABLEA_GLOBALID": "{EFCE8592-7D91-4DD4-93D8-8CEDCE661427}",
"CREATOR": "UnitTest",
"CREATED": 1412695974000,
"CHANGER": "UnitTest",
"CHANGEDATE": 1412695974000
}
},
{
"attributes": {
"OBJECTID": 3000,
"AREANUMBER": 2,
"ARCHIVE": 0,
"GLOBALID": "{17C7D5EE-09BD-4F3D-AE08-51C47E1C885E}",
"TABLEA_GLOBALID": "{EFCE8592-7D91-4DD4-93D8-8CEDCE661427}",
"CREATOR": "UnitTest",
"CREATED": 1412695974000,
"CHANGER": "UnitTest",
"CHANGEDATE": 1412695974000
}
}
]
}
]
}
This looks like an issue we've seen with GUID fields in related tables that is slated to be fixed in the next version. I'm curious, if you perform your query using a QueryTask and filter out the 'TABLEA_GLOBALID' field if it will return successfully. Please try the following type of query with your data:
var relParam = new RelationshipParameters(new long[] { 1L }, 0L);
relParam.OutFields = new OutFields(new string[] { "AREANUMBER", "ARCHIVE", "GLOBALID" });
var queryTask = new QueryTask(new Uri(FeatureServiceUrl));
var result = await queryTask.ExecuteRelationshipQueryAsync(relParam);
-Greg
Tried and that works so problem is those esriFieldTypeGUID fields.
Need to make workaround and wait bug fix...
Thanks Greg