Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you have inputs in the header formula, it becomes tricky. As described above, the input generation is on the item level and drops all non-generated inputs as it considers them outdated.

The (tick) The conclusion is that ideally the line item logic should create these inputs. Then they will stay.

...

IssueResolution

If you create an input for a line item in the header logic (through quoteProcessor.addOrUpdateInput()) and create a quote revision, the values from the inputs disappear.

This happens only for line items; when added to ROOT, the inputs preserve their values.

Code Block
titleHeader Logic Snippet
for (lineItemMap in quoteProcessor.getQuoteView().lineItems) {
    if (lineItemMap.folder) continue  //skip folders
    
    quoteProcessor.addOrUpdateInput(lineItemMap.lineId,
            ["name"     : "SampleInput",
             "type"     : InputType.STRINGUSERENTRY,
             "required" : true
            ]
    )
}


The desired behavior somehow conflicts with another standard behavior. 

The solution is to have an input defined at the line items level.

The code snippet here can be fixed just by adding a single formula element to the calculation logic for a line item:

Code Block
api.stringUserEntry("SampleInput")

Then the header logic can even stay as is. 

With this change, the input exists in the revision too.

...