Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This page contains information which may be useful when implementing a full app, or when using the API to synchronize data with Microbizz.

Synchronization

You will often want to maintain up-to-date list of the most important objects, like customers, tasks, persons, equipments etc. That way you can lookup details of eg. a customer instantly, without having to communicate with the Microbizz server. This is usually called 'synchronization', and requires that you call eg. GetCustomersByLastChange regularly, eg. every 10 minutes or 1/2 hour or whatever you find reasonable.

API calls whose name end in …ByLastChange require that you specify the date+time of the last time you call the API call. The API call then returns all the objects that have changed since then.

The API calls may return a 'resumekey' value. This indicates that the call didn't return all the objects that have changed. You should then call the same API call again, with the same date+time and also specify the resumekey value that you just received. Repeat this until the API call no longer returns a resumekey value. The API call will return date+time of when Microbizz received the request. This should be used as date+time the next time you synchronize.

F.ex.:

getcustomersbylastchange_date = '1970-01-01'
getcustomersbylastchange_time = '00:00:00'

function synccustomers()
  resumekey = false
  do
    data = GetCustomersByLastChange(getcustomersbylastchange_date, getcustomersbylastchange_time, resumekey)
    if (data.resumekey)   resumekey = data.resumekey
  while (data.resumekey)
  // remember date+time for next time 
  getcustomersbylastchange_date = data.date
  getcustomersbylastchange_time = data.time
endfunction

A more details discussion of synchronization can be found here: discussion of synchronization

An overview of which objects are read during sync can be found here: which objects are read by the app

Complex types that are objects

The following complex types are objects that should preferably be available when an app is offline. Other complex types (like budgetarea, eventtype, mainpagebox, persontype and many more) are considered part of the setup of Microbizz and need only be read during synchronization. Typically the offline objects are those that the app may send to Microbizz, whereas the remaining objects are only read by the app.

call, customer, directorderline, event, depotorderline, document, feature, invoiceline, message, tmessage, mbmessage, note, partuse, person, prodplanentry, product, registrationentry, salescontact, salescontractline, todo, todoitem, tool, thread, unit, user

  • No labels