Device Synchronization Returns no Data

Problem: Improper syntax in generated code calls causes device synchronization to return no data.

Explanation: This may originate from a misconception about the syntax of generated code calls. In this code example, the deployment_unit file, customer_list_unit.xml, used to autogenerate the class objects, contains this section:

<synchronization-parameter name="city" type="string?"/>

This indicates that the class object created from the XML requires "city" to be specified prior to syncing with the object. For example:

>CustomerSynchronizationParameters params = Customer.getCustomerSynchronizationParameters();
>params.setCity("New York");
>params.save();

Solution: Research the mobile business object (MBO) design in Eclipse.

  1. Verify that the MBO Filter By attribute is reflected on the client side by the synchronization parameters. Use the default_value attribute to specify a default value:
    <synchronization-parameter name="city type="string?" default-value="NewYork"/>
  2. After making the change, regenerate the classes, and resynchronize the MBO on the device.