<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/da/onlinemanual/000502" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Filter</Title>
		<Keyword ContextSensitive="No"><Level1>Synchronization Server</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>Synchronization Object</Level1>
		</Keyword>
		<Keyword ContextSensitive="No"><Level1>Filter</Level1>
		</Keyword>
	</Header>
	<GeneralSection><Paragraph class="Default">Filtering is choosing specific object instances or component instances, while leaving out others that are irrelevant.</Paragraph>
		<Paragraph class="Default">A filter is a specification of the conditions that must be met to include a particular object or component in the synchronization scope. For example, only includes orders having status 'released'. Or only include order lines having a planned date filled in.</Paragraph>
		<Paragraph class="Default">The filter will result in excluding irrelevant business object instances or component instances. A filter is used for performance optimization, because it avoids data being sent that is irrelevant for any client.</Paragraph>
		<Paragraph class="Default">Filtering is done by attaching an XML text to the synchronization object. This is done in the <Link href="/baanerp/da/nch/danch2510m000" role="session">Synchronization Objects (danch2510m000)</Link> session. If a synchronization object is created automatically via the <Link href="/baanerp/da/glossary/glossary#61" role="glossary">PublishChanges</Link> method, the filter text is generated.</Paragraph>
		<Paragraph class="Default">You can specify a filter by defining a ComparisonExpression or by combining multiple ComparisonExpressions using a LogicalExpression. The filter in the <Link href="/baanerp/da/glossary/glossary#60" role="glossary">PublishList</Link> and PublishChanges request is equal to the filter used for the List and Show methods.</Paragraph>
		<ExampleSection><SectionTitle>
                                 Example
                              </SectionTitle>
			<List><ListIntro>Assume the following filters must be applied on the components of an Order business object:</ListIntro>
				<ListItem>Order header: (lifecycle = “approved”) or (lifecycle = “toBePlanned”)</ListItem>
				<ListItem>Order line: deliveryDate &lt; “2004-01-01T00:00:00Z”</ListItem>
			</List>
			<Paragraph class="Default">Then the filter XML will be:</Paragraph>
			<CodeBlock space-and-orientation="indented-estimated">    &lt;LogicalExpression&gt;
        &lt;logicalOperator&gt;and&lt;/logicalOperator&gt;
        &lt;LogicalExpression&gt;
            &lt;logicalOperator&gt;or&lt;/logicalOperator&gt;
            &lt;ComparisonExpression&gt;
                &lt;comparisonOperator&gt;eq&lt;/comparisonOperator&gt;
                &lt;attributeName&gt;lifeCycle&lt;/attributeName&gt;
                &lt;instanceValue&gt;approved&lt;/instanceValue&gt;
            &lt;/ComparisonExpression&gt;
            &lt;ComparisonExpression&gt;
                &lt;comparisonOperator&gt;eq&lt;/comparisonOperator&gt;
                &lt;attributeName&gt;lifeCycle&lt;/attributeName&gt;
                &lt;instanceValue&gt;toBePlanned&lt;/instanceValue&gt;
            &lt;/ComparisonExpression&gt;
        &lt;/LogicalExpression&gt;
        &lt;ComparisonExpression&gt;
            &lt;comparisonOperator&gt;le&lt;/comparisonOperator&gt;
            &lt;attributeName&gt;deliveryDate&lt;/attributeName&gt;
            &lt;instanceValue&gt;2004-01-01T00:00:00Z&lt;/instanceValue&gt;
        &lt;/ComparisonExpression&gt;
    &lt;/LogicalExpression&gt;
</CodeBlock>
		</ExampleSection>
		<Important><SectionTitle>
                                 Important!
                              </SectionTitle>
			<List><ListItem>Filters are defined per object, but they are applied per component, if a component instance exists. You must take this into account, when you define a filter for an aggregated (multi-level) business object. If the attribute values are out of range, only the involved component instance (and its children, if any) is removed. Sibling components instances or parents are not impacted. If the top-level component is out of range, the complete object is out of range.</ListItem>
				<ListItem>You cannot define filters that aggregate multiple component instances, such as: <List><ListItem>Only include orders having at least one order line.</ListItem>
						<ListItem>Only include orders whether the total amount for all order lines exceeds $ 1,000.</ListItem>
					</List>
				</ListItem>
				<ListItem>Within the scope of a logical 'or' expression, you can use attributes from only one component. It is no use to define a filter such as: Order.date is empty or OrderLine.date is empty.</ListItem>
				<ListItem>No filtering should be done on attributes that get their value from outside the business object (e.g. from a related business object).</ListItem>
			</List>
		</Important>
		<Paragraph class="Default">For other details on filtering, including a procedure on how to define a filter, refer to the <DocRef>Synchronization and Event Publishing Deployment Guide</DocRef>.</Paragraph>
	</GeneralSection>
	<GeneralSection><SectionTitle>More information</SectionTitle>
		<List><ListIntro>For more information, refer to:</ListIntro>
			<ListItem><Link href="/baanerp/da/onlinemanual/000500a" role="manual">Synchronization Server - User Interface Overview</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/da/onlinemanual/000500b" role="manual">Synchronization Server - User Tasks</Link>
			</ListItem>
			<ListItem><Link href="/baanerp/da/onlinemanual/000400" role="manual">Event Publishing Overview</Link>
			</ListItem>
			<ListItem><DocRef>Synchronization and Event Publishing Deployment Guide</DocRef> This deployment guide describes among other things: <List><ListItem>The specifications for the PublishList, PublishChanges and UnpublishChanges methods.</ListItem>
					<ListItem>How to use these methods.</ListItem>
					<ListItem>How to use the Synchronization Server to set up, optimize and manage the event publishing.</ListItem>
					<ListItem>Important things to take into account when setting up the synchronization or event handling.</ListItem>
					<ListItem>What to do in case of problems.</ListItem>
				</List>
			</ListItem>
		</List>
	</GeneralSection>
</ManualTopic>
