Common APIs

In addition to Object State APIs these APIs are available with each mobile business object.

  • save – save a record to the local database, In the case of an existing record, save calls update. In the case of a new record, save calls create.
  • refresh – client refreshes the entity from the local database.
  • cancelPending – cancels a pending record.
  • submitPending – submits a pending record to the server.
  • getPendingChange – if pending is true, then 'C' (create), 'U' (update), 'D' (delete), 'P' (to indicate that this row is a parent in a cascading relationship for one or more pending child objects, but this row itself has no pending create, update or delete operations). If pending is false, then 'N'.
  • getReplayCounter – updated each time a row is created or modified by the client. This value is derived from the time in seconds since an epoch, so it always increases each time the row is changed.
  • getReplayPending – when a pending row is submitted to the server, the value of replayCounter is copied to replayPending. This allows client code to detect if a row has been changed since it was submitted to the server --the test to look for : replayCounter > replayPending. On receiving a successful response (replayResult) from the server, this is reset to 0.
  • getReplayFailure – when the server responds with a replayFailure message for a row that was submitted to the server, the replayCounter value is copied to replayFailure, and replayPending is set to 0.