There's a method Object option(String entryName, List<Object> options, Map<String,Object> labels)
which allows you to set values' labels in the drop-down. To set these labels when adding the drop-down in a quote header logic, use the following examples.
This is a header-level drop-down with simple options (just the list of values):
Code Block |
---|
def endCustomerList = [ "customer1", "customer2", "customer3", "customer4", "customer5", "customer6" ] quoteProcessor.addOrUpdateInput("ROOT", ["name" : "RequestorendCustomer", "label" : "RequestorEnd Customer", "type" : InputType.OPTIONSOPTION, "valueOptions" : endCustomerList, ]) |
Now you need to split names and labels. To do so, put the labels into the field "parameterConfig" as a sub-map with the name "labels":If you want to add labels, you need to assign a map with key "labels" to a field "parameterConfig". The "labels" will contain your map with key-value pairs, where key is the name of the option and value is the label.
Code Block |
---|
def labelsmapWithLabels = [ "customer1" "A": "First Customer", "customer2" : "LabelSecond ACustomer", "Bcustomer3" : "LabelThird BCustomer" ] quoteProcessor.addOrUpdateInput("ROOT", ["name" : "FreightTermsendCustomer", "label" : "FreightEnd TermsCustomer", "type" : InputType.OPTION, "valueOptions" : optionsendCustomerList, "parameterConfig" : [ "labels": labelsmapWithLabels ] ]) |