GetFieldValuesResult GetFieldValues(OdId tOb, GetFieldValuesArg tArg)
tOb. Moniker of opened relational object instance.
tArg. Operation execution parameters.
The GetFieldValues operation gets unique values of the field to be used in autofilter.
Before executing this operation, the CreateFieldFilterState operation must be executed for the corresponding field. To execute the GetFieldValues operation, in the tOb field specify moniker of opened relational object instance, and in the tArg.pattern field specify the patter that will be used to get unique field values. The moniker can be obtained on executing the OpenTable, OpenQuery operations. In tArg one should also set moniker of the relation object cache that can be obtained using the GetTable/GetQuery operations with the cachedDataset field specified in the pattern.
The operation results in the obtained unique values of relational data source field.
The SetFieldFilter operation is used to use autofilter values. The made changes are applied after executing the CloseFieldFilterState operation. To get filtered records from the relational data source, call the GetTable/GetQuery operations again.
It is assumed that there is the table opened for view, table moniker and table cache moniker are obtained. The table contains a field with the REGION identifier.
Below is the example of getting unique table field values that can be used in autofilter. The request contains two monikers, field identifier, and the searched value. The response contains the obtained unique field values containing the searched value.
{
"GetFieldValues" :
{
"tOb" :
{
"id" : "NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!TABLECMPCMBCJHDEIGOAEHNKFEHGJCOOAFFIEIJCFENIDGAPBKEPP"
},
"tArg" :
{
"pattern" :
{
"columnId" : "REGION",
"cachedDatasetId" :
{
"id" : "NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!CACHEDDATASETOKBHDCCJHDEIGOAEPEALCLNDILEJPILEBJGJBCLICJLOHKBD"
},
"search" : "krai",
"range" :
{
"start" : "0",
"count" : "20"
}
}
}
}
}
{
"GetFieldValuesResult" :
{
"id" :
{
"id" : "NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!TABLECMPCMBCJHDEIGOAEHNKFEHGJCOOAFFIEIJCFENIDGAPBKEPP"
},
"values" :
{
"it" :
[
{
"v" : "Altai krai",
"selected" : "1"
},
{
"v" : "Zabaykalsky krai",
"selected" : "1"
},
{
"v" : "Kamchatka krai",
"selected" : "1"
},
{
"v" : "Krasnodar krai",
"selected" : "1"
},
{
"v" : "Kransoyarsk krai",
"selected" : "1"
},
{
"v" : "Perm krai",
"selected" : "1"
},
{
"v" : "Primorsky krai",
"selected" : "1"
},
{
"v" : "Stavropol krai",
"selected" : "1"
},
{
"v" : "Khabarovsk krai",
"selected" : "1"
}
]
},
"total" : "9",
"selectAllState" : "All"
}
}
public static GetFieldValuesResult GetFieldValues(string tableMoniker, string tableCacheMoniker, string fieldId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetFieldValues()
{
tArg = new GetFieldValuesArg()
{
pattern = new FieldValuesPattern()
{
cachedDatasetId = new OdId() { id = tableCacheMoniker },
columnId = fieldId,
range = new ListRange() { count = 20, start = 0 },
search = "krai"
}
},
tOb = new OdId() { id = tableMoniker }
};
// Get unique field values
var result = somClient.GetFieldValues(tGet);
return result;
}
See also: