...
Configurator Logic
The logic is executed after clicking the Open button of Configurator.
After clicking the Save button of a popup Configurator, a new configurator value is saved to the Quote object. (Quote object is what you get by calling
quoteProcessor.getQuoteView()
.) But you cannot work with the values until the quote is recalculated. Why? All the logic knows is the old quote object since all other calculation logics finished before the configurator logic was executed. You must click the Recalculate button or set automatic recalculation; to learn more see how to recalculate a quote automatically.
Template Logic
The logic is executed after clicking the download PDF button.
From the template logic the whole quote object is accessible through
api.getCurrentItem()
.
...
But this is does not work because:
Line item configurator “test” is created during the syntax check.
During the syntax check,
api.input
returns only mock data, not real data.During the syntax check (and only during the syntax check),
api.getParameter("test")
returns a context parameter of the "test" configurator. During recalculation (when the syntax check is not running),api.getParameter("test")
returns null.ConfA?.setValue
in the syntax check:Has a context parameter of the configurator.
Does not have a value loaded from
api.input
.
ConfA?.setValue
when the quote is recalculated:Does not have a context parameter of the configurator.
Has a value loaded from
api.input
but it cannot be set, as confA is null.
As a result:
You can set a static value via
confA.setValue()
as the value is known during the syntax check.You cannot dynamically set loaded data from the header configurator because in the syntax check
api.input
does not return an expected value and during recalculation,api.getParameters("test")
does not return the context parameter of the configurator.
...