Overriding the Default Filter by Setting

You may want to override the default attribute/parameter Filter by setting defined in Unwired WorkSpace.

By default:
  • Filter by is unselected for profile arguments.
  • Filter by is selected for non profile arguments.

You may want to change the default Filter by setting after dragging and dropping a data source to create the MBO, then editing the MBO definition by adding any result-affecting parameter (which must have Filter by selected), for example:

select * from sampledb.dba.sales_order where sales_rep = '@OP["sales_rep"=""]

Since different values of "sales_rep" generate different result sets, the parameter "sales_rep" is result-affecting.

An operation that includes user name and password parameters does not affect the results; in this case leave Filter by unselected.
Note: Sometimes profile parameters affect results, for example, a Web service that returns different results for different users. Unwired Server cannot determine (either at deployment or runtime) whether a parameter is incorrectly marked, you must override the default.

In summary, when developing MBOs, you must select Filter for MBO parameters that affect results and leave it unselected for MBO parameters that do not affect results. Do not change the default Filter by setting for an MBO parameter unless you have a profile parameter for which different values of the parameter return different results.

Attribute/parameter usage and Filter by settings
Type Playback? Sync? Description
Attribute No Yes An attribute is a sync parameter and the table must be filtered further by that column for downloading to the device.
Profile parameter Yes No A playback parameter is not a sync parameter if it does not affect the playback results. This is typical of profile parameters such as user name and password. However, some profile parameters, such as an e-mail object, do affect results.

When developing MBOs, profile parameters that do not affect playback results have a default setting of unselected for Filter by. If a different login produces different results, unselect Filter by.

Operation parameter Yes Yes Playback parameters, for example region, almost always affect the results and as such are also sync parameters.

Operation-specific parameters, such as a custId parameter in an orders MBO, are invariably result-affecting. The default setting for Filter by for these parameters is selected, and there is rarely a reason to change that setting.

Example 1

An example of an operation parameter: Say you have a "WorkOrder" MBO that includes an "assigned_to" parameter and a "customer" parameter. Users can search for work orders that have been assigned to themselves, but only to retrieve work orders related to a particular customer. While defining this MBO:

If you want the device application to have work order data for only one customer at a time, unselect Filter by for "customer". Each time a user changes their customer parameter, Unwired Server reads back work orders for only that customer. Since the work orders are all different from the previous customer, a differential calculation deletes all previous work order rows in the Consolidated Database (CDB) for the current user, and inserts new rows with the new work orders. The differential sync deletes all old rows and insert new ones on the client.

If you unselect Filter by for both the user and customer, the entire CDB table is emptied each time a user syncs. This behavior is almost never desired.