On the Quote detail page, there are 2 buttons, which cause quote recalculation. The difference is in how many lines are calculated.
-
Recalculate - all line items are recalculated
-
Recalculate Changes - recalculate only the line items, which have some changes against the previously calculated version. (Note, that the button is on the line item’s panel with input parameters.)
A change of the line is, for example:
-
change of item’s input field
-
change of item’s label
-
change of item’s result override
-
change of header input field
A line item has field dirty
, which is set by system to true for each line, which should be recalculated.
-
So for "full" recalculation, all items will be marked dirty.
-
For Recalculate Changes, only lines with some changes
If you want, you can read the value of the item’s dirty
field in the header logic’s post-phase, and do only processing of the recalculated items.
-
The user clicks on Recalculate or Recalculate Changes
-
The system calls the quote header logic in pre-phase
-
usually the header logic creates input fields on the header, but can also change the structure of the document
-
-
The system sets the
dirty
flag for line items, either for all or only for the modified ones -
for each "dirty" item the system will
-
call the quote item logic
-
take the logic’s element results, and store it on the line item
-
-
the system executes the header logic in post-phase
-
usually the header logic calculates some summarized results and creates the result fields
-
-
the user can see the recalculated results on the screen