Update Operation

The update operation updates a record in the local database on the device. To execute update operations on an MBO, get an instance of the MBO, set the MBO attributes, then call either the save() or update() operation. To propagate the changes to the server, call submitPending.

Customer cust = Customer.findById(101);
cust.setFname("supAdmin");
cust.setCompany_name("Sybase");
cust.setPhone("777-8888");
cust.save(); // or cust.update();
cust.submitPending();
<PkgName>DB.synchronize(); 
// or <PkgName>DB.synchronize (String synchronizationGroup)

To update multiple MBOs in a relationship, call submitPending() on the parent MBO, or call submitPending() on the changed child MBO:

Customer cust = Customer.findById(101);
com.sybase.collections.ObjectList orders = cust.getSalesOrders();
SalesOrder order = (SalesOrder)orders.getByIndex(0);
order.setOrder_date(new java.util.Date());
order.save();
cust.submitPending();