...
To avoid the need to declare input parameters explicitly (they show up as you start using/expecting them in the formula), a mechanism called “syntax check mode” is used (sometimes also called "dry run").
As the name implies, it not only determines inputs but also checks the formula for syntactical validity. This is e.g. the reason why a formula is executed in that mode once before saving it to prevent invalid formulas to be saved.
...
Code Block |
---|
def inputVal = api.userEntry()
if (api.isSyntaxCheck()) return;
def costs = api.find("PX", equal("name", "costs")) |
Note:
api.getElement()
will return always a BigDecimal number, regardless of its value returned during regular execution of the logic.Also some other functions will return "null" instead of proper values.
api.stream
andDatamartContext.streamQuery()
are not supported in syntax check, butapi.find
is.