Hallo zusammen,
ich will die Bestände für verschiedene Lager die PlentyGetVariations in VariationStocksPhysical zurückliefert addieren, aber halt nur, wenn das Lager eben auch in der Map ist.
Konkret geht es um die IDs, die Addition soll
${VariationStocksPhysical.at("20")?number + VariationStocksPhysical.at("24")?number}
sein. Ich dachte mir das so:
<#if (isNumber(VariationStocksPhysical.at("20")) && isNumber(VariationStocksPhysical.at("24")))> ${VariationStocksPhysical.at("20")?number + VariationStocksPhysical.at("24")?number} <#elseif (isNumber(VariationStocksPhysical.at("20"))> ${VariationStocksPhysical.at("20")} <#elseif (isNumber(VariationStocksPhysical.at("24"))> ${VariationStocksPhysical.at("24")} <#else> 0 </#if>
Dann bekomme ich aber ein
Das Wert-Feld enthält Fehler. (Root Causes: ParseException: Syntax error in template "StocksPhysical" in line 4, column 3: You can't use ${...} (an interpolation) here as you are already in FreeMarker-expression-mode. Thus, instead of ${myExpression}, just write myExpression. (${...} is only used where otherwise static text is expected, i.e., outside FreeMarker tags and interpolations, or inside string literals.))
zurück. Ja, okay, dann entferne ich die ${...} innerhalb der if/else-Anweisungen. Dann gibts aber ein
Das Wert-Feld enthält Fehler. (Root Causes: ParseException: Syntax error in template "StocksPhysical" in line 1, column 270: Encountered "<", but was expecting one of: "." ".." <DOT_DOT_LESS> "..*" "?" "??" "!" "[" "(" ")" <TERMINATING_EXCLAM>)
Hä? Ist bestimmt nur irgendwo ein Syntaxfehler, aber ich komm nicht weiter. Könnt ihr helfen?
Grüße Daniel