MBO Update Fails

Problem: A mobile business object (MBO) that you edited using the C# client API fails to update upon synchronization.

Solution:
  1. Check the Logs Screen for the detailed log record.
  2. If the log record does not provide enough information, check the C# client API code for errors, for example:

    int id = 777; //it's the customer id
    Customer cust = Customer.FindBy(id);
    cust.Name = "some other name";
    cust.Update();
    cust.SubmitPending();
    DBClass.Synchronize();
    //...
    //you verify operation log that indicates the update failed at backend server
    //...
    cust = Customer.FindBy(id);
    cust.Delete();
    cust.SubmitPending();
    DBClass.Synchronize(); 
    //...
    //you verify operation log that indicates the delete failed
    //...

    Call CancelPending() after the failed update operation to delete the MBO, for example:

    int id = 777; //it's the customer id
    Customer cust = Customer.FindBy(id);
    cust.Name = "some other name";
    cust.Update();
    cust.SubmitPending();
    DBClass.Synchronize();
    //...
    //you verify operation log that indicates the update failed at backend 
    servercust = Customer.FindBy(id);
    //...
    Customer customer = Customer.FindById(id);
    if(errorHappened) 
    {
      Customer.CancelPending();
    }
    else 
    {
      customer.SubmitPending();
    }
    //...
    //you verify operation log that indicates the delete succeeded
    //...