How to Mass Update Quotes with a Configurator

If you have in your implementation a header-level configurator with user inputs that you want to modify during a quote mass update, this section helps you configure a solution.

This is a sample logic that defines a configurator:

def ce = api.createConfiguratorEntry() def annualRebate = ce.createParameter(InputType.INTEGERUSERENTRY, "AnnualRebate") annualRebate.setLabel("Annual Rebate %") if (annualRebate.getValue() == null) { annualRebate.setValue(0) } return ce

The quote header logic will look similar to this one:

def configuratorValue = getInputValue("configurator") def customerId = getInputValue("Customer") if (quoteProcessor.isPrePhase()) { quoteProcessor.addOrUpdateInput("ROOT", ["name" : "configurator", "label": "Header", "type" : "INLINECONFIGURATOR", "url" : "QuoteHeaderConfigurator", "value": configuratorValue] ) api.logInfo("quote in prephase1", quoteProcessor.getHelper().getRoot().inputs) } return def getInputValue(inputName) { return quoteProcessor.getHelper().getRoot().getInputByName(inputName)?.value }

Now you must create a header input mass update logic. This logic will generate an input parameter in the Set Parameters step of the Mass Update dialog. If you need to update the input with a static value, simply replace the "r" in the below code with the required value:

def r = api.integerUserEntry("annualRebate") def c = api.currentItem('inputs').find { it.name == "configurator" } if (c != null && c.value != null) { c.value["AnnualRebate"] = r } return c?.value

To be able to see the inner configurator's input on the mass update Summary page, add it to the Modified Inputs table in the following format: configuratorName___inputName (note that there must be three underscores).

 

Found an issue in documentation? Write to us.

Â