Sometimes it is required to pass values from a header logic to line items that this logic creates. You can use the HIDDEN input type and reference it in the calculation logic.
The following code sample creates a new quote line with parameters fetched from the header logic:
def params = [[name:"MyHiddenParam", type: InputType.HIDDEN, value:"ABC"]] quoteProcessor.addLineItem("ROOT","MB-0003",params) |
In the line calculation logic, this value then can be retrieved by:
def val = api.input("MyHiddenParam") |
Notes:
You can also set default values for items created using the quoteStructure class:
def params = [[name:"MyHiddenParam", type: InputType.HIDDEN, value:"ABC"]] def qs = new QuoteStructure() qs.addPart("MySKU",params) //use add.Folder for a folder |