Update document

There is one api function to update the document is self. 

con.con.update(parentid, "myrefid", "New name", "New info", MgmtAPI.STATUS_PROGRESS, userstatus, progress, max);

A following fields can be updated at a document  
  • information (text)
  • user status (int)
  • progress (int)
  • progress max (int)
  • name(text)
Additional to the document it self extra fields can be added and updated. The extra fields are printed at the top in an expanded document. Setting the same field again will update the value. The example bellow has 2 extra fields

con.setExtra(parentid, "myrefid", "Tot Payed", "235.45", MgmtAPI.TYPE_GREY_LABEL);
con.setExtra(parentid, "myrefid", "Not Payed", "50.45", MgmtAPI.TYPE_ORANGE_LABEL);

Adding attachments. The 3:de parameter can specify the attachment name when left empty or null the name of the attached file path is used. The last parameter the filepath is a fully qualified path to a file that must exist. The attachments are listed at the bottom in an expanded document

con.con.addDoc(parentid, "myrefid", null, filepath);
con.con.addDoc(parentid, "myrefid", "mynew.pdf", filepath);

Setting an error text to a document
con.setError(parentid, "myrefid", "Some thing is terrible wrong");

A convince method to update just the progress value. Note the document must be in the PROGRESS state to show the progress bar. 
con.updateProgress(parentid, "myrefid", 3, 10);