<?xml version="1.0" encoding="utf-8"?>
<Session ID="/baanerp/da/trg/datrg1110m000" xml:lang="en">
	<Header>
		<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Configure Trigger Conditions (datrg1110m000)</Title>
	</Header>
	<HelpTopic xml:lang="en"><AimSection><Paragraph class="Default">
                                 Use this session to enter one or more conditions for a trigger.</Paragraph>
		</AimSection>
		<GeneralSection><Paragraph class="Default">You can define multiple separate conditions that are connected via a logical 'And' or via a logical 'Or'. Refer to the online field help for more information. Conditions defined for a trigger will only check the top level component. This session is a modal dialog. When you leave this session and return to the <Link href="/baanerp/da/trg/datrg1100m000" role="session">Triggers (datrg1100m000)</Link> session, the trigger program is regenerated automatically, if the action settings were changed.</Paragraph>
			<ExampleSection><SectionTitle>
                                    Example
                                 </SectionTitle>
				<Paragraph class="Default">The following example shows a setup for three triggers.</Paragraph>
				<Paragraph class="Default">Triggers:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">Trigger</TD>
							<TD rowspan="1" colspan="1">Description</TD>
							<TD rowspan="1" colspan="1">Path for Program</TD>
							<TD rowspan="1" colspan="1">Condition Template</TD>
						</TR>
					</THEAD>
					<TBODY><TR><TD rowspan="1" colspan="1">quotation</TD>
							<TD rowspan="1" colspan="1">New quotation created in ERP</TD>
							<TD rowspan="1" colspan="1">e:\Trigger\Objects</TD>
							<TD rowspan="1" colspan="1">Dialog</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">customer</TD>
							<TD rowspan="1" colspan="1">Customer is made inactive</TD>
							<TD rowspan="1" colspan="1">e:\Trigger\Objects</TD>
							<TD rowspan="1" colspan="1">Dialog</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">order</TD>
							<TD rowspan="1" colspan="1">Order status changed</TD>
							<TD rowspan="1" colspan="1">e:\Trigger\Objects</TD>
							<TD rowspan="1" colspan="1">Dialog</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph class="Default">Conditions for 'quotation' trigger:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">Seq. Nr.</TD>
							<TD rowspan="1" colspan="1">And / Or</TD>
							<TD rowspan="1" colspan="1">Type</TD>
							<TD rowspan="1" colspan="1">Comp.</TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Operator</TD>
							<TD rowspan="1" colspan="1">Value</TD>
							<TD rowspan="1" colspan="1">Becomes</TD>
						</TR>
					</THEAD>
					<TBODY><TR><TD rowspan="1" colspan="1">10</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">Class</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">=</TD>
							<TD rowspan="1" colspan="1">Quotation</TD>
							<TD rowspan="1" colspan="1"></TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">20</TD>
							<TD rowspan="1" colspan="1">And</TD>
							<TD rowspan="1" colspan="1">Event</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">=</TD>
							<TD rowspan="1" colspan="1">Create</TD>
							<TD rowspan="1" colspan="1"></TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">30</TD>
							<TD rowspan="1" colspan="1">And</TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Quotation</TD>
							<TD rowspan="1" colspan="1">Status</TD>
							<TD rowspan="1" colspan="1">=</TD>
							<TD rowspan="1" colspan="1">Entered</TD>
							<TD rowspan="1" colspan="1">No</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph class="Default">Note that the condition on Class is only needed if the same trigger can receive events from multiple different classes.</Paragraph>
				<Paragraph class="Default">Conditions for 'customer' trigger:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">Seq. Nr.</TD>
							<TD rowspan="1" colspan="1">And / Or</TD>
							<TD rowspan="1" colspan="1">Type</TD>
							<TD rowspan="1" colspan="1">Comp.</TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Operator</TD>
							<TD rowspan="1" colspan="1">Value</TD>
							<TD rowspan="1" colspan="1">Becomes</TD>
						</TR>
					</THEAD>
					<TBODY><TR><TD rowspan="1" colspan="1">10</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Customer</TD>
							<TD rowspan="1" colspan="1">Status</TD>
							<TD rowspan="1" colspan="1">&lt;&gt;</TD>
							<TD rowspan="1" colspan="1">Active</TD>
							<TD rowspan="1" colspan="1">Yes</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">20</TD>
							<TD rowspan="1" colspan="1">Or</TD>
							<TD rowspan="1" colspan="1">Event</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">=</TD>
							<TD rowspan="1" colspan="1">Delete</TD>
							<TD rowspan="1" colspan="1">No</TD>
						</TR>
						<TR><TD rowspan="1" colspan="1">30</TD>
							<TD rowspan="1" colspan="1">And</TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Customer</TD>
							<TD rowspan="1" colspan="1">Status</TD>
							<TD rowspan="1" colspan="1">=</TD>
							<TD rowspan="1" colspan="1">Active</TD>
							<TD rowspan="1" colspan="1">No</TD>
						</TR>
					</TBODY>
				</TABLE>
				<Paragraph class="Default">Conditions for 'order' trigger:</Paragraph>
				<TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated"><THEAD><TR><TD rowspan="1" colspan="1">Seq. Nr.</TD>
							<TD rowspan="1" colspan="1">And / Or</TD>
							<TD rowspan="1" colspan="1">Type</TD>
							<TD rowspan="1" colspan="1">Comp.</TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Operator</TD>
							<TD rowspan="1" colspan="1">Value</TD>
							<TD rowspan="1" colspan="1">Becomes</TD>
						</TR>
					</THEAD>
					<TBODY><TR><TD rowspan="1" colspan="1">10</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1">Attribute</TD>
							<TD rowspan="1" colspan="1">Order</TD>
							<TD rowspan="1" colspan="1">Status</TD>
							<TD rowspan="1" colspan="1">Changed</TD>
							<TD rowspan="1" colspan="1"></TD>
							<TD rowspan="1" colspan="1"></TD>
						</TR>
					</TBODY>
				</TABLE>
			</ExampleSection>
		</GeneralSection>
		<RelatedTopics><SectionTitle>
                                 Related topics
                              </SectionTitle>
			<RelTopic><Link href="/baanerp/da/onlinemanual/000300" role="manual">Triggering</Link>
			</RelTopic>
		</RelatedTopics>
	</HelpTopic>
	<Fields><FieldHelp ID="datrg110.seqn"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Sequence Number</Title>
			</Header>
			<FuncDesc>A number to indicate the sequence in which:</FuncDesc>
			<SimpleSection><List><ListItem>the conditions must be evaluated.</ListItem>
					<ListItem>the conditions are displayed</ListItem>
				</List>
				<Paragraph class="Default">If two conditions have the same sequence number, the evaluation sequence is equal to the sequence in which the user entered or saved the conditions.</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg110.bopr"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">And/Or</Title>
			</Header>
			<FuncDesc>The Boolean operator that indicates how a condition is linked to the previous one:</FuncDesc>
			<SimpleSection><List><ListItem>'Or' (the entire trigger condition is met if one of the conditions is met), or</ListItem>
					<ListItem>'And' (the entire trigger condition is met if all conditions are met).</ListItem>
				</List>
				<Paragraph class="Default">This field is unused for the first condition. Note that no parentheses () are available for defining conditions. So, a condition such as:</Paragraph>
				<Paragraph class="Default"><Code>eventtype is 'create' and (status = 2 or status = 3)</Code>
				</Paragraph>
				<Paragraph class="Default">must be defined as:</Paragraph>
				<Paragraph class="Default"><Code>eventtype is 'create' and status = 2 or event type = 'create' and status = 3.</Code>
				</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg110.ctyp"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Condition Type</Title>
			</Header>
			<FuncDesc>A condition can check either the event type, the class or an attribute value. Therefore the condition types are :</FuncDesc>
			<SimpleSection><List><ListItem>Attribute Value</ListItem>
					<ListItem>Event Type</ListItem>
					<ListItem>Class</ListItem>
				</List>
				<Paragraph class="Default">If you choose a value other than 'Attribute Value', the attribute is irrelevant and cannot be filled.</Paragraph>
				<Paragraph class="Default">You only need Conditions on class or event type if the same trigger is invoked for events on multiple classes or event types.</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg110.attr"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Attribute</Title>
			</Header>
			<FuncDesc>The name of the attribute to be checked.</FuncDesc>
		</FieldHelp>
		<FieldHelp ID="datrg110.oper"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Operator</Title>
			</Header>
			<FuncDesc>The comparison operator that is used for the class, event type or attribute. Available operators are</FuncDesc>
			<SimpleSection><List><ListItem>Equal (=)</ListItem>
					<ListItem>Not Equal (&lt;&gt;)</ListItem>
					<ListItem>Less Than (&lt;)</ListItem>
					<ListItem>Less Than or Equal To (&lt;=)</ListItem>
					<ListItem>Greater Than (&gt;)</ListItem>
					<ListItem>Greater Than or Equal To (&gt;=)</ListItem>
					<ListItem>Changed. You can use this operator to test whether the value of an attribute differs from the previous value.</ListItem>
				</List>
				<List><ListIntro>Notes regarding the 'Changed' operator:</ListIntro>
					<ListItem>In case of a create or delete event all attributes are 'changed'. In case of change events however, some attributes may have changed while others are not 'changed'.</ListItem>
					<ListItem>You can only select the 'Changed' operator if the condition type is 'Attribute Value'.</ListItem>
					<ListItem>If you select the 'Changed' operator, you cannot enter a value for the attribute.</ListItem>
				</List>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg110.valu"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Value</Title>
			</Header>
			<FuncDesc>The value that must be checked. If the condition type is 'Event Type', the value must be 'create', 'change', 'delete' or another event type that can be input for the trigger.</FuncDesc>
			<SimpleSection><Paragraph class="Default">If the condition type is 'Class' the value must be a class that can be used in a trigger.</Paragraph>
				<Paragraph class="Default">In other cases the value is an attribute value that must be checked.</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg110.dtyp"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Data Type</Title>
			</Header>
			<FuncDesc>The type of the attribute used in the condition.</FuncDesc>
			<SimpleSection><List><ListItem>Enter "Number" if the attribute to be checked contains a numeric value (either with or without decimals).</ListItem>
					<ListItem>Enter "String" if the attribute to be checked contains a string.</ListItem>
				</List>
				<Paragraph class="Default"><GUIRef href="" role="manual">Note</GUIRef>
				</Paragraph>
				<Paragraph class="Default">You can only edit this field when the condition type is "Attribute Value" and the operator is unequal to "Changed". In all other cases the data type is irrelevant</Paragraph>
				<Paragraph class="Default"><GUIRef href="" role="manual">Notes on numbers and strings</GUIRef>
				</Paragraph>
				<Paragraph class="Default">The following examples show how numbers are handled differently from strings.</Paragraph>
				<List><ListIntro>Conditions on string values:</ListIntro>
					<ListItem>If myAttribute contains "hello", condition myAttribute = "0" is not met</ListItem>
					<ListItem>If myAttribute contains "", condition myAttribute = "0" is not met</ListItem>
					<ListItem>If myAttribute contains "1234", condition myAttribute = " 1234" is not met</ListItem>
					<ListItem>If myAttribute contains "456", condition myAttribute &gt; "12345" is met</ListItem>
				</List>
				<List><ListIntro>The same conditions on numeric values:</ListIntro>
					<ListItem>If myAttribute contains "hello", condition myAttribute = "0" is met (because the 'value' of "hello" is 0)</ListItem>
					<ListItem>If myAttribute contains "", condition myAttribute = "0" is met</ListItem>
					<ListItem>If myAttribute contains "1234", condition myAttribute = " 1234" is met (because both values are equal)</ListItem>
					<ListItem>If myAttribute contains "456", condition myAttribute &gt; "12345" is not met (because 456 is less than 12345)</ListItem>
				</List>
				<Paragraph class="Default">For strings, leading spaces are relevant, but trailing spaces in the Value field are not taken into account. So a condition myAttribute = " 1234 " is regarded as: myAttribute = " 1234".</Paragraph>
				<Paragraph class="Default"><GUIRef href="" role="manual">Notes on specific data types</GUIRef>
				</Paragraph>
				<List><ListItem>Enumerate descriptions are strings, enumerate values are numbers.</ListItem>
					<ListItem>Date and time numbers are numbers, formatted dates are strings. Note that if the date format is DDMMYYYY, for example, a comparison condition using '&lt;', '&lt;=, '&gt;' or '&gt;=' will not be useful. Either use another date format (such as YYYYMMDD) in that case, or program the condition in an Attached Script.</ListItem>
					<ListItem>For numbers having decimals, use a '.' as the decimal sign.</ListItem>
					<ListItem>Numbers in exponential format are handled as numbers.</ListItem>
					<ListItem>Text numbers are numbers.</ListItem>
				</List>
				<Paragraph class="Default">Complex data types (such XML sub-trees containing text contents) cannot be handled in a condition.</Paragraph>
			</SimpleSection>
		</FieldHelp>
		<FieldHelp ID="datrg110.becm"><Header>
				<Title xmlns:HTML="http://www.w3.org/TR/REC-html40">Becomes</Title>
			</Header>
			<FuncDesc>This field indicates when a condition is met:</FuncDesc>
			<SimpleSection><List><ListItem>Becomes = No: the condition is met if either the old or the new attribute value meets the condition</ListItem>
					<ListItem>Becomes = Yes: the condition is met only if the old value does not meet the condition but the new value does.</ListItem>
				</List>
				<Paragraph class="Default">For detailed information, refer to <Link href="/baanerp/da/onlinemanual/000305" role="manual">The 'becomes' setting</Link>
				</Paragraph>
			</SimpleSection>
		</FieldHelp>
	</Fields>
</Session>
