When you have selected an event, you can use a filter to determine in more detail if the event should cause notifications to be sent when it is raised.
For example, if have you selected the "Order amount greater than 10,000" event for a "Sales order" business entity, Business Notification will receive a document from Navision each time this event occurs. However, you could also decide that, in addition to the decision already made inside Navision about the order amount, in your company you only want to have notifications sent to subscribers if the sales order is for a customer in Denmark. You can use a filter on the country code to ensure this.
Each set of drop-down lists and text boxes that you see on the Filter form represents a filter on one data field in the document received from Navision. More lines, with additional filter settings, can be added by clicking Add. An existing line can be removed by clicking Delete.
The following describes the elements of each line in the Filter form.
Business entity fields: A list of fields from the business entity. For example: "Country Code."
Operator: How the parameter (business entity field) should be compared to the value. The options that are available depend upon the type (Date/Time, Text, Number or Boolean) of the parameter:
Date/Time fields, such as the Order Date field, can have the following operators: Equal To; Equal To or After; Equal To or Before; Before; After.
Text fields, such as the Vendor Name field, can have the following operator: Is exactly.
Number fields, such as the Amount field, can have the following operators: Equals; Not Equal To; Equals or More Than; Equals or Less Than; More Than; Less Than.
Boolean fields are fields that can only have two values: Yes or No. They can have the following operators: Is; Is Not.
Value: The actual value from Navision that the parameter should be compared against. For example:
The event is "Sales order amount above 10,000", but you are only interested in sending notifications if the customer in this case is in the United States.
Select "Country Code" as the parameter. Because this a text value, you can choose between the operators that are applicable for text fields.
You want an exact match for a specific country code, so select "Is exactly" as the operator.
Finally, enter "U.S." as the value, because you want to only send notifications for customers in the United States.
Note: you cannot look up the value in the Navision database from the Notification Designer. You may want to check the possible values in Navision if you are in doubt about spelling and so on (by using the regular Navision client interface).
Relation: The relation is only relevant if you add lines to the filter. You add a line by clicking Add. The relation determines how the settings on each line should be combined. There are two possible values:
AND: Settings on lines connected by an AND relation should all be met at the same time.
For example, if you want to create a filter that sends notifications only when the "Country Code" parameter is "U.S." and the "Location Code" is 1, you create these two lines as described above and join them with an AND relation.
OR: Either one of the settings on lines connected by an OR relation should be met.
For example, if you want to create a filter that sends notifications only when the "Country Code" is "U.K." or when the "Country Code" is "DK" you create these two lines as described above and join them with an OR relation.
What happens if you have more than 2 lines and want to join them with relations?
If you want to use the same relation to join all lines, there is no problem. Using only the AND relation, you could express that "Country Code" must be "U.S.", and "Location Code" must be "1", and "Status" must be "Open", and "Project Code" must be "Blue" all at the same time.
A series of AND relations are most often (but not exclusively) used when you want to filter on a set of different fields.
If you want to express that "Country Code" could be either "U.S.", "DK" or "U.K.", you would use the OR relation to join such three lines.
A series of OR relations are most often (and almost exclusively) used to pick certain values out of the set of possible values for the same field.
The problem arises when you want to combine AND and OR. The concise description of what happens is that AND has precedence over OR, and that the relations are evaluated from left-to-right (which, in the way that the form is laid out, is from up-to-down). Using a mixed set of relations can be confusing but can often be avoided be creating more than one scheme. For more information about interpreting a combination of AND and OR relations click here.