Unloaded values

Hello,

I have table Documents and Documents Items.

I wanna use script to summ values of specific field at Documents Items.

var TotalExclVAT = 0;

TotalExclVAT = doo.model.DOC_documentsItems.value.DI_totalExcludeVAT._$$sum
doo.model.DOC_totalExcludesVAT.value = TotalExclVAT;

If I create new document and also new row in documents items and then save it. Zero is saved even if value is 100. If I edit this document record and save it again it works - I need to re-open that record (when it is opened again values are changed and save it properly) - why?

Hi,
These changes are calculated by server after save (asynchronously).
These are not available during record edit or before save.
(And the same applies to calculated fields.)
We are sorry for the problems you are having with this.
Regards
Michal

Hello micu

in table Documents I have a few types of documents - such as: Issued, or Received

Each type has different formula to be calculated.

Is there any way how to solve this problem?