CreateFieldFilterState

Syntax

CreateFieldFilterStateResult CreateFieldFilterState(OdId tOb, CreateFieldFilterStateArg tArg)

Parameters

tOb. Moniker of opened relational object instance.

tArg. Operation execution parameters.

Description

The CreateFieldFilterState operation creates a settings storage area for autofilter by field values.

Comments

The operation is used to work with data of opened relational data source instance - tables, external tables, query, view, log. A storage area for each single field can be created only once. Settings in the storage area will be overwritten on next calls. To execute the operation, in the tOb field specify moniker of opened relational object instance, and in the tArg field specify information about the field that is required to create settings. 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 result determines whether the autofilter settings storage area was created successfully.

To work with autofilter, use the GetFieldValues, SetFieldFilter operations. To close the autofilter settings storage area, use the CloseFieldFilterState operation. Autofilter settings can be fully deleted from memory after the relational object is closed using the CloseTable/CloseQuery operations.

Example

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 creating an autofilter settings storage area for the specified table field. The request contains two monikers and field identifier. The response contains whether a settings storage area is created successfully.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateFieldFilterState xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!TABLECMPCMBCJHDEIGOAEHNKFEHGJCOOAFFIEIJCFENIDGAPBKEPP</id>
  </tOb>
<tArg xmlns="">
  <columnId>REGION</columnId>
<cachedDatasetId>
  <id>NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!CACHEDDATASETOKBHDCCJHDEIGOAEPEALCLNDILEJPILEBJGJBCLICJLOHKBD</id>
  </cachedDatasetId>
  </tArg>
  </CreateFieldFilterState>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<CreateFieldFilterStateResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <success xmlns="">1</success>
  </CreateFieldFilterStateResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"CreateFieldFilterState" :
{
"tOb" :
{
"id" : "NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!TABLECMPCMBCJHDEIGOAEHNKFEHGJCOOAFFIEIJCFENIDGAPBKEPP"
},
"tArg" :
{
"columnId" : "REGION",
"cachedDatasetId" :
{
"id" : "NLDGBACJHDEIGOAEOJMGHOOJDGJFPBFEFJEKHLKPOKBAEPOF!M!S!CACHEDDATASETOKBHDCCJHDEIGOAEPEALCLNDILEJPILEBJGJBCLICJLOHKBD"
}
}
}
}

JSON response:

{
"CreateFieldFilterStateResult" :
{
"success" : "1"
}
}
public static CreateFieldFilterStateResult CreateFieldFilterState(string tableMoniker, string tableCacheMoniker, string fieldId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tCreate = new CreateFieldFilterState()
{
tArg = new CreateFieldFilterStateArg()
{
cachedDatasetId = new OdId() { id = tableCacheMoniker },
columnId = fieldId
},
tOb = new OdId() { id = tableMoniker }
};
// Create an autofilter settings storage area
var result = somClient.CreateFieldFilterState(tCreate);
return result;
}

See also:

Working with Relational Objects of Repository