Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2017-07-21 05:30 AM
Hello!
I'm trying to use filters in ExecuteSearch method (web services).
When using <ReferenceFilterCondition>, I need to specify level ID. According to guide: "The SQL ID of the level in which the record resides. All applications have at least one level. The Level element uses the Content sub-element to specify the SQL ID of the content."
Where I can get required level id?
Thanks and best regards,
Sergei
2017-07-21 10:46 AM
The REST API can get metadata information about Archer modules, levels, fields, etc. To get the Level Id via REST API, check out Metadata Level. To get a list of Levels, use this URL: api/core/system/level.
Another trick is to create an Archer Report in the Web UI and set the Filter and Sorting. Then call one of the Search methods like GetSearchOptions or GetSearchOptionsByGuid to get the <SearchReport> XML string...which will include the Level Id.
Regarding the <ReferenceFilterCondition> filter, below are a couple examples. One example uses EQUALS and the other CONTAINS. The 13908 field is the Related Records field. For more info and other examples, check out these links:
<SearchReport>
<DisplayFields>
<DisplayField>540</DisplayField>
<DisplayField>13908</DisplayField>
</DisplayFields>
<PageSize>50</PageSize>
<Criteria>
<Filter>
<Conditions>
<ReferenceFilterCondition>
<Field>13908</Field>
<Operator>Contains</Operator>
<IsNoSelectionIncluded>False</IsNoSelectionIncluded>
<Level id="191">
<Content>205532</Content>
</Level>
</ReferenceFilterCondition>
</Conditions>
</Filter>
<ModuleCriteria>
<Module>84</Module>
<IsKeywordModule>True</IsKeywordModule>
<BuildoutRelationship>Union</BuildoutRelationship>
</ModuleCriteria>
</Criteria>
</SearchReport>
<SearchReport>
<DisplayFields>
<DisplayField>540</DisplayField>
<DisplayField>13908</DisplayField>
</DisplayFields>
<PageSize>50</PageSize>
<Criteria>
<Filter>
<Conditions>
<ReferenceFilterCondition>
<Field>13908</Field>
<Operator>Equals</Operator>
<IsNoSelectionIncluded>False</IsNoSelectionIncluded>
<Level id="191">
<Content>205532</Content>
</Level>
</ReferenceFilterCondition>
</Conditions>
</Filter>
<ModuleCriteria>
<Module>84</Module>
<IsKeywordModule>True</IsKeywordModule>
<BuildoutRelationship>Union</BuildoutRelationship>
</ModuleCriteria>
</Criteria>
</SearchReport>
2017-07-21 10:25 AM
Within the Application Builder of the application you’re trying to find the level ID of,
Change the structure of the application from Standard to Leveled (Outline) - Make sure not to hit save or apply here
Hover over the Name of the level, and you’ll see the ID in the bottom right corner.
There’s other ways to go about getting it through the REST API which might be easier since you’re already making calls.
2017-07-21 10:46 AM
The REST API can get metadata information about Archer modules, levels, fields, etc. To get the Level Id via REST API, check out Metadata Level. To get a list of Levels, use this URL: api/core/system/level.
Another trick is to create an Archer Report in the Web UI and set the Filter and Sorting. Then call one of the Search methods like GetSearchOptions or GetSearchOptionsByGuid to get the <SearchReport> XML string...which will include the Level Id.
Regarding the <ReferenceFilterCondition> filter, below are a couple examples. One example uses EQUALS and the other CONTAINS. The 13908 field is the Related Records field. For more info and other examples, check out these links:
<SearchReport>
<DisplayFields>
<DisplayField>540</DisplayField>
<DisplayField>13908</DisplayField>
</DisplayFields>
<PageSize>50</PageSize>
<Criteria>
<Filter>
<Conditions>
<ReferenceFilterCondition>
<Field>13908</Field>
<Operator>Contains</Operator>
<IsNoSelectionIncluded>False</IsNoSelectionIncluded>
<Level id="191">
<Content>205532</Content>
</Level>
</ReferenceFilterCondition>
</Conditions>
</Filter>
<ModuleCriteria>
<Module>84</Module>
<IsKeywordModule>True</IsKeywordModule>
<BuildoutRelationship>Union</BuildoutRelationship>
</ModuleCriteria>
</Criteria>
</SearchReport>
<SearchReport>
<DisplayFields>
<DisplayField>540</DisplayField>
<DisplayField>13908</DisplayField>
</DisplayFields>
<PageSize>50</PageSize>
<Criteria>
<Filter>
<Conditions>
<ReferenceFilterCondition>
<Field>13908</Field>
<Operator>Equals</Operator>
<IsNoSelectionIncluded>False</IsNoSelectionIncluded>
<Level id="191">
<Content>205532</Content>
</Level>
</ReferenceFilterCondition>
</Conditions>
</Filter>
<ModuleCriteria>
<Module>84</Module>
<IsKeywordModule>True</IsKeywordModule>
<BuildoutRelationship>Union</BuildoutRelationship>
</ModuleCriteria>
</Criteria>
</SearchReport>