Specifying Synchronization Parameters

Use synchronization parameters within the mobile application to download filtered MBO data.

Assign the synchronization parameters of an MBO before a synchronization session. The next synchronize sends the updated synchronization parameters to the server. The SynchronizationParameters class is within the generated code for your project.

Note: If you do not save the SynchronizationParameters, no data is downloaded to the device even if there are default values set for those SynchronizationParameters. Call the save method for all SynchronizationParameters and for all MBOs when the application is first started. Do this after application registration and the first synchronization.
  1. Retrieve the synchronization parameters object from the MBO instance. For example, if you have an MBO named Customer, the synchronization parameters object is accessed as a public field and returned as a CustomerSynchronizationParameters object:
    CustomerSynchronizationParameters sp = Customer.getSynchronizationParameters();
  2. Assign values to the synchronization parameter. For example, if the Customer MBO contains a parameter named cityname, assign the value to the CustomerSynchronizationParameters object's Cityname field:
    sp.setCityname("Kansas City");
  3. Save your changes by calling the synchronization parameters object's save method:
    sp.save();
    Note: If you defined a default value or bound a PersonalizationParameters in the SynchronizationParameters, then that value will not take effect unless you call sp.save().

    After you save the synchonization parameters, call another synchronize() to download the data.

  4. When using synchronization parameters to retrieve data from an MBO during a synchronization session, clear the previous synchronization parameter values:
    CustomerSynchronizationParameters sp = Customer.getSynchronizationParameters();
    sp.delete();
    sp = Customer.getSynchronizationParameters();//Must re-get synchronization parameter instance.
    sp.setCityname("New City");
    sp.save();
Related concepts
Synchronizing
Related reference
Synchronization APIs