Class ContextParameter
- All Implemented Interfaces:
Serializable
The object holds the definition of one input: its name, type, label and settings. It also holds the value that the user entered or selected. The server stores the input definition, including this value, in JSON format.
A logic gets an input in these ways:
- The input builders of
api.inputBuilderFactory()create it.buildContextParameter()returns it, and so doesbuildFormInput()in a form logic (Forms 2.0). api.getParameter(name)returns an input that the logic generated earlier, for example withapi.option().ConfiguratorEntry.createParameter(InputType, String)andConfiguratorEntry.getFirstInput()return the inputs of a Configurator.
quoteProcessor.addOrUpdateInput() in a header logic and layout.addChild() in a form logic.
Example: sets the label, the required flag and the default value of an input that the logic generated earlier:
def qty = api.integerUserEntry("Quantity")
def p = api.getParameter("Quantity")
if (p != null && p.getValue() == null) {
p.setLabel("Quantity (default: 1)")
p.setRequired(true)
p.setValue(1)
}
return qty ?: 1
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNot intended for public use.ContextParameter(String name, DMFieldCollection fc, String field, String defaultValue) Not intended for public use.ContextParameter(InputType type, String name) Not intended for public use.ContextParameter(InputType type, String name, Object value) Not intended for public use.Not intended for public use.ContextParameter(LookupTable lt, String defaultValue) Not intended for public use. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInput(ContextParameter contextParameter) Adds a nested input.voidaddParameterConfigEntry(String key, Object value) Technically the same functionality assetConfigParameter(String, Object).Changes the input type of this input.voidclearConfigParameter(String paramName) Clears the value of a configuration option: sets it tonull.Not intended for public use.booleanReturns the flag set withsetAddUnknownValues(Boolean).Returns whether the input field is always editable.Returns the filter of this input, as a map.Returns the formatting options of the input: the options that influence how the input field looks.Returns the nested inputs of aROWorCOLLAPSEinput.Returns the input type.getLabel()Returns the label of the input: the text displayed as the label of the input field.Returns the translations of the label, as a JSON string.Returns the ID of the lookup table that aLOOKUPorMATRIXLOOKUPinput reads its values from.getName()Returns the name of the input.Returns the parameter configuration of the input: the options that modify how the input field behaves.Returns the name of the parameter group (the collapsible section in the UI) that the input belongs to.Returns the preference name of an Input Matrix or Configurator Table input.Returns whether the input field is read-only.Returns the frontend events registered for this input withonClick()oronValueChange()of the input builder.getType()Returns the input type as a string, for example"OPTION".Returns the typed ID of the object that the logic runs for, for example the typed ID of the Quote when the Quote is calculated.getURL()Returns the URL property of the input.Returns the user groups whose members can edit the input.Returns the user groups whose members can see the input.getValue()Returns the value of the input: the value that the user entered or selected, or the default value set withsetValue(Object).Returns the value hint: a text that the UI shows with the value of the input.String[]Returns the options of a drop-down input, set withsetValueOptions(String[]).inthashCode()final booleanReturns whether this input is a customer input.booleanReturns whether the advanced filter of a table input is on.booleanReturns whether the client filter of a table input is on.final booleanReturns whether this input is a hidden input.Returns whether the changes of this input are recorded in the activity log.booleanReturns whether this input is a lookup input.final booleanReturns whether this input is a matrix lookup input.final booleanReturns whether this input is a drop-down input with a single selection.final booleanReturns whether this input is a drop-down input with multiple selection.final booleanReturns whether this input is a product group input.final booleanReturns whether this input is a product input.Returns whether the input must have a value.Returns whether the logged changes of this input are kept as an audit trail.setAddUnknownValues(Boolean addUnknownValues) Sets whether the user can add values that are not among the options of anOPTIONSinput.setAlwaysEditable(Boolean alwaysEditable) Sets the input field as always editable.setConfigParameter(String paramName, Object value) Adds an additional configuration parameter/option to the input – aparameterConfigproperty.Sets the filter of this input, as a map.setFilters(Filter... filters) Sets the filter of this input from one or moreFilterobjects.setFormattingOption(String optionName, Object value) Sets (adds or updates) a formatting option (how the input field is displayed) within the formattingOptions map.voidsetFormattingOptions(Map<String, Object> formattingOptions) Allows you to set desired formatting options of the input field as a map.voidsetIfNotNull(ContextParameter original) Not intended for public use.Sets the label of the input parameter to the given text.setLabelTranslations(String labelTranslations) Sets the translations of the label as a JSON string.setLabelTranslationsFromMap(Map<String, String> translations) Sets the translations of the label.setLogActivity(Boolean logActivity) Sets whether the changes of this input are recorded in the activity log of the document.setParameterConfig(Map<String, Object> parameterConfig) Sets the behavior of the input field.setParameterGroup(String parameterGroup) Allows you to create collapsible sections that organize inputs in the UI.setReadOnly(Boolean readOnly) Sets the input field as read-only.voidNot intended for public use.setRequired(Boolean required) Sets, if it's mandatory for the input parameter to have a value.setStoreAuditTrail(Boolean storeAuditTrail) Sets whether the logged changes of this input are kept as an audit trail.setTypedId(String typedId) Sets the typed ID returned bygetTypedId().Sets the URL property of the input.voidsetUserGroupEdit(String userGroupEdit) Sets the userGroupEdit property for the input.setUserGroupView(String userGroupView) Sets the userGroupView property for the input.setUserGroupView(List<String> userGroupsView) Sets the userGroupView property for the input.Set initial/default value of the input parameter.setValueHint(String hint) Sets the value hint: a text that the UI shows with the value of the input.setValueOptions(String[] valueOptions) Sets list of options used in the dropdown input field.setValueOptions(List<String> valueOptions) Sets the options of the drop-down input field, as a list.toString()voidNot intended for public use.voidupdateFromFormulaInputDescriptor(FormulaInputDescriptor fid) Not intended for public use.voidNot intended for public use.
-
Field Details
-
FRONTEND_EVENT_DEPENDENT_INPUTS
- See Also:
-
-
Constructor Details
-
ContextParameter
public ContextParameter()Not intended for public use. The server uses this constructor to read inputs from JSON. Useapi.inputBuilderFactory()to create an input.- See Also:
-
ContextParameter
Not intended for public use. Useapi.inputBuilderFactory()to create an input.- See Also:
-
ContextParameter
Not intended for public use. Useapi.inputBuilderFactory()to create an input.- See Also:
-
ContextParameter
Not intended for public use. Useapi.inputBuilderFactory()to create an input.- See Also:
-
ContextParameter
Not intended for public use. Useapi.inputBuilderFactory()to create an input.- See Also:
-
ContextParameter
Not intended for public use. Useapi.inputBuilderFactory()to create an input.- See Also:
-
-
Method Details
-
updateFromFormulaInputDescriptor
public void updateFromFormulaInputDescriptor(FormulaInputDescriptor fid) Not intended for public use. The server calls this method to apply the input settings defined in the configuration of a pricing logic, such as the label, the group and the format. -
addParameterConfigEntry
Technically the same functionality assetConfigParameter(String, Object).Unlike
setConfigParameter(), this method does not return the input, so you cannot chain further calls.- Parameters:
key- The name of the configuration option. SeesetConfigParameter(String, Object)for the options.value- The value of the configuration option.- See Also:
-
updateWithLookupTable
Not intended for public use.This is a convenience method to update a ContextParameter with a new version of the same lookup table. This can happen e.g. if a quote is worked on a while and passes a validity date border or an old quote is copied.
The method does nothing if the input is not a
LOOKUPorMATRIXLOOKUPinput, or if its name differs from the unique name of the lookup table.- Parameters:
lt-
-
isLookupType
public boolean isLookupType()Returns whether this input is a lookup input.- Returns:
trueif the input type isInputType.LOOKUPorInputType.MATRIXLOOKUP- See Also:
-
isCustomerParam
public final boolean isCustomerParam()Returns whether this input is a customer input.- Returns:
trueif the input type isInputType.CUSTOMER
-
isProductParam
public final boolean isProductParam()Returns whether this input is a product input.- Returns:
trueif the input type isInputType.PRODUCT
-
isProductGroupParam
public final boolean isProductGroupParam()Returns whether this input is a product group input.- Returns:
trueif the input type isInputType.PRODUCTGROUP
-
isMatrixParam
public final boolean isMatrixParam()Returns whether this input is a matrix lookup input.- Returns:
trueif the input type isInputType.MATRIXLOOKUP
-
isOptionParam
public final boolean isOptionParam()Returns whether this input is a drop-down input with a single selection.- Returns:
trueif the input type isInputType.OPTION- Since:
- 3.3 - Cosmopolitan
- See Also:
-
isOptionsParam
public final boolean isOptionsParam()Returns whether this input is a drop-down input with multiple selection.- Returns:
trueif the input type isInputType.OPTIONS- Since:
- 3.5.4 - Salty Dog
- See Also:
-
isHiddenParam
public final boolean isHiddenParam()Returns whether this input is a hidden input.- Returns:
trueif the input type isInputType.HIDDEN- Since:
- 3.3 - Cosmopolitan
-
isEnableClientFilter
public boolean isEnableClientFilter()Returns whether the client filter of a table input is on. The client filter allows a user to filter the table by row values. Applies toInputType.INPUTMATRIXandInputType.CONFIGURATORTABLEinputs.- Returns:
- the boolean flag informing whether the client filter is on (
true) or off (false). Turned on by default. - Since:
- 13.0 - Rampur
- See Also:
-
isEnableAdvancedFilter
public boolean isEnableAdvancedFilter()Returns whether the advanced filter of a table input is on. The advanced filter allows a user to filter the table with advanced filters. Applies toInputType.INPUTMATRIXandInputType.CONFIGURATORTABLEinputs.- Returns:
- the boolean flag informing whether the advanced filter is on (
true) or off (false). Turned off by default. - Since:
- 13.0 - Rampur
- See Also:
-
getPreferenceName
Returns the preference name of an Input Matrix or Configurator Table input. The input builders set it withwithPreferenceName(), which stores it as the "preferenceName" configuration option.- Returns:
- the preference name
- Since:
- 13.0 - Rampur
- See Also:
-
isRequired
Returns whether the input must have a value.- Returns:
- the required flag set with
setRequired(Boolean) - See Also:
-
setRequired
Sets, if it's mandatory for the input parameter to have a value. The value can be either entered by user or a default value. A required input field is marked with an asterisk (*) in the user interface.In case of Quote, all required fields must be populated, otherwise you cannot submit the Quote for approval.
Example:
api.getParameter("Quantity")?.setRequired(true)- Parameters:
required- If the input value will be required or not.- Returns:
- this input
- See Also:
-
getName
Returns the name of the input. A logic reads the value of the input under this name, for exampleinput.Quantity.- Returns:
- the name of the input
-
getLabel
Returns the label of the input: the text displayed as the label of the input field.- Returns:
- the label of the input
- See Also:
-
setLabel
Sets the label of the input parameter to the given text.Example:
api.getParameter("Quantity")?.setLabel("Quantity (default: 1)")- Parameters:
label- The text to be displayed as label of the input field.- Returns:
- this input
- See Also:
-
getLabelTranslations
Returns the translations of the label, as a JSON string. The JSON object maps 2-letter language codes (ISO 639-1) to labels, for example{"de":"Menge","es":"Cantidad"}.- Returns:
- the translations of the label, as a JSON string
- Since:
- 3.3 - Cosmopolitan
- See Also:
-
setLabelTranslationsFromMap
Sets the translations of the label.If the label translation is specified for a specific language, then this translation is used when the UI is switched into that language. The translation with an empty language code is used for the languages that have no translation.
Example:
api.getParameter("Quantity")?.setLabelTranslationsFromMap([ "de": "Menge", "es": "Cantidad" ])- Parameters:
translations- The map that defines language codes (2-letterISO 639-1) and input field labels.- Returns:
- this input
- Since:
- 5.1 - Collins
- See Also:
-
setLabelTranslations
Sets the translations of the label as a JSON string. To pass the translations as a map, usesetLabelTranslationsFromMap(Map).- Parameters:
labelTranslations- A JSON object that maps 2-letter language codes (ISO 639-1) to labels, for example{"de":"Menge"}.- Returns:
- this input
- Since:
- 3.3 - Cosmopolitan
- See Also:
-
getFilter
Returns the filter of this input, as a map.- Returns:
- the filter set with
setFilter(Map)orsetFilters(Filter...)
-
setFilter
Sets the filter of this input, as a map. To build the filter fromFilterobjects, usesetFilters(Filter...).- Parameters:
filter- The filter, as a map.- Returns:
- this input
- See Also:
-
setFilters
Sets the filter of this input from one or moreFilterobjects. The filters are combined with AND and stored as a map, whichgetFilter()returns.- Parameters:
filters- The filters to combine.- Returns:
- this input
- See Also:
-
getParameterGroup
Returns the name of the parameter group (the collapsible section in the UI) that the input belongs to.- Returns:
- the name of the parameter group
- See Also:
-
setParameterGroup
Allows you to create collapsible sections that organize inputs in the UI. You can assign parameterGroup to each parameter, and they will get categorized. The order of parameter groups (sections) is based on the order in which they are "created" (declared) when the logic is executed. There is one default group for all those that do not have parameterGroup assigned.This is supported for Quotes, Contracts and Rebate Agreements (not for Configurators).
Example:
api.getParameter("Quantity")?.setParameterGroup("Volume")- Parameters:
parameterGroup- The name of the parameter group.- Returns:
- this input
- See Also:
-
getURL
Returns the URL property of the input. What it holds depends on the input type. For example, for a Configurator input it is the name of the Configurator logic, and for a button it is the URL that the button opens.- Returns:
- the URL property of the input
- See Also:
-
setURL
Sets the URL property of the input. The input builders set this property, for exampleButtonInputBuilder.setUrl(String).- Parameters:
url- The value of the URL property. SeegetURL().- Returns:
- this input
-
getType
Returns the input type as a string, for example"OPTION".- Returns:
- the name of the input type
- See Also:
-
getInputType
Returns the input type.- Returns:
- the input type
- See Also:
-
applyType
Changes the input type of this input.- Parameters:
inputType- The new input type.- Returns:
- this input
- See Also:
-
getValueHint
Returns the value hint: a text that the UI shows with the value of the input. For example, aMULTITIERENTRYinput shows it next to its fields. For the customer input of a Quote, the server sets it to the name of the selected customer.- Returns:
- the value hint
- See Also:
-
setValueHint
Sets the value hint: a text that the UI shows with the value of the input.- Parameters:
hint- The text of the hint.- Returns:
- this input
- See Also:
-
getValueOptions
Returns the options of a drop-down input, set withsetValueOptions(String[]).- Returns:
- the options of the drop-down input
-
setValueOptions
Sets list of options used in the dropdown input field. This works only for input parameters created viaapi.option()andapi.options()Example:
api.option("Country") // ... api.getParameter("Country").setValueOptions(["USA", "DE"])- Parameters:
valueOptions- The options of the drop-down input field.- Returns:
- this input
- See Also:
-
setValueOptions
Sets the options of the drop-down input field, as a list. Same assetValueOptions(String[]).- Parameters:
valueOptions- The options of the drop-down input field.- Returns:
- this input
-
getLookupTableId
Returns the ID of the lookup table that aLOOKUPorMATRIXLOOKUPinput reads its values from.- Returns:
- the ID of the lookup table
- See Also:
-
getValue
Returns the value of the input: the value that the user entered or selected, or the default value set withsetValue(Object). The type of the value depends on the input type.- Returns:
- the value of the input
- See Also:
-
setValue
Set initial/default value of the input parameter.Important: in line item logics, this makes sense only in the "input generation" mode (formerly called Syntax Check mode). You cannot set the initial value of input field later during regular execution.
In header logics and Configurators, the value set by this method overwrites a value entered by the user when the logic runs again, for example when the user clicks Recalculate on the header.
Example:
def p = api.getParameter("Quantity") if (p != null && p.getValue() == null) { p.setValue(1) }- Parameters:
value- The initial value of the input field.- Returns:
- this input
- See Also:
-
getReadOnly
Returns whether the input field is read-only.- Returns:
- the read-only flag set with
setReadOnly(Boolean)
-
setReadOnly
Sets the input field as read-only. The user cannot enter or edit the value in this field.Example:
api.getParameter("Quantity")?.setReadOnly(true)- Parameters:
readOnly- Set totrueto set the input field as read-only.- Returns:
- this input
- See Also:
-
setParameterConfig
Sets the behavior of the input field.This method replaces the whole parameter configuration of the input, including the options set before. To add or change one option, use
setConfigParameter(String, Object).Example:
api.getParameter("Price")?.setParameterConfig(["formatType": "MONEY_USD", "dataType": "float"])- Parameters:
parameterConfig-Config parametersas a map.- Returns:
- this input
- See Also:
-
getParameterConfig
Returns the parameter configuration of the input: the options that modify how the input field behaves. SeesetConfigParameter(String, Object)for the options.- Returns:
- the parameter configuration, as a map of option names and values
- See Also:
-
setUserGroupView
Sets the userGroupView property for the input.
nullwhich means no restrictions.Only the members of the specified user groups see the input. For other users, the input is not rendered and is not included when the object is fetched. An empty value also means no restrictions.
The restriction applies to the top-level inputs of Custom Forms, for example the inputs passed to
customFormProcessor.addOrUpdateInput(). It does not apply to nested inputs, such as the inputs of an inline Configurator or of a row layout.NOTE:
- the property is set as a configuration parameter
- the value can be at most 255 characters long, otherwise the method throws an exception
- each usage of the method on a single input will override the value
def country = api.inputBuilderFactory() .createOptionEntry("Country") .setOptions(["CZ", "DE", "UK"]) .buildContextParameter() country.setUserGroupView("sales_managers,marketing_team") customFormProcessor.addOrUpdateInput(country)- Parameters:
userGroupView- a user group name, or several user group names separated by commas- Returns:
- this input
- Throws:
IllegalArgumentException- ifuserGroupViewis longer than 255 characters- Since:
- 15.0 - Southside
- See Also:
-
setUserGroupView
Sets the userGroupView property for the input.
nullor emptyCollectionsets the property tonullwhich means no restrictions.Works like
setUserGroupView(String). Blank names are left out, and the other names are joined with commas.NOTE:
- the property is set as a configuration parameter
- if concatenation of the user group names (with comma delimiter) exceeds 255 characters, the method throws an exception
- each usage of the method on a single input will override the value
def country = api.inputBuilderFactory() .createOptionEntry("Country") .setOptions(["CZ", "DE", "UK"]) .buildContextParameter() country.setUserGroupView(["sales_managers", "marketing_team"]) customFormProcessor.addOrUpdateInput(country)- Parameters:
userGroupsView- the list of user group names- Returns:
- this input
- Throws:
IllegalArgumentException- if the joined user group names are longer than 255 characters- Since:
- 15.0 - Southside
- See Also:
-
getUserGroupView
Returns the user groups whose members can see the input.- Returns:
- the user group names, separated by commas
- Since:
- 15.0 - Southside
- See Also:
-
setUserGroupEdit
Sets the userGroupEdit property for the input. Only the members of the specified user groups can edit the input. Other users see it as read-only, also when the input is always editable (seesetAlwaysEditable(Boolean)).nullor an empty value means no restrictions.Each usage of the method on a single input overrides the value.
Example:
api.getParameter("Discount")?.setUserGroupEdit("sales_managers,pricing_team")- Parameters:
userGroupEdit- a user group name, or several user group names separated by commas- Since:
- 14.0 - Caribou Lou
- See Also:
-
getUserGroupEdit
Returns the user groups whose members can edit the input.- Returns:
- the user group names, separated by commas
- Since:
- 14.0 - Caribou Lou
- See Also:
-
setConfigParameter
Adds an additional configuration parameter/option to the input – aparameterConfigproperty. This option modifies how the input field behaves.You can use following
paramNamewith respective values:paramName Description formatTypeSets the format type of the input field (e.g. for "PERCENT" the input will be displayed with % sign and the value returned will be 0..1 instead of 0..100). For possible values, see the FieldFormatTypeenum.fromSets the minimum value of the allowed value range. Applicable to the following input types: INTEGERUSERENTRY, USERENTRY, DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY, SLIDER. toSets the maximum value of the allowed value range. Applicable to the following input types: INTEGERUSERENTRY, USERENTRY, DATETIMEUSERENTRY (accepts date limits only), DATEUSERENTRY, SLIDER. labelsSets labels to be used for the options, For example ["USA":"United States of America, "DE":"Germany]. Applicable to the OPTION input type. disabledHides the input from the user interface. Supported input types: InputType.CONFIGURATOR(hides the "Open" button).dataTypeSets the data type of the input field. For example "float", or "integer". Applicable to the following input types: USERENTRY, BOOLEANUSERENTRY, DATEUSERENTRY, DATETIMEUSERENTRY, HIDDEN, INTEGERUSERENTRY, PARSABLEINPUTFILE, QUOTETYPE, REBATEAGREEMENT, TEXTUSERENTRY, TIMEUSERENTRY. noRefreshBoolean – Applicable to input fields within a Configurator only. Prevents the Configurator refresh when the value of the field is changed. See setNoRefresh()for more details.dmSourceNameName of DS or DM (only for DMFilterBuilder, DMFields or DMField). typeCodeString – sets the type to be filtered. For FILTERBUILDER input type only. targetPageOpens the target location (AppPage). Applicable to the BUTTON input type only. See setTargetPage()for more details.targetPageStateOpens the particular object detail in the specified location (set by the targetPage). Applicable to the BUTTON input type only. SeesetTargetPageState()for more details.filterFormulaName of the logic which will provide a filter used to limit products/customers in the picker. Example: cp.setConfigParameter("filterFormula", ["name": "ProductFilter_Logic"]). Applicable to the following input types: PRODUCT, PRODUCTGROUP, CUSTOMER, CUSTOMERGROUP.autoFocusBoolean – If this is set to true, browser scrolls to the element when the page is loaded and automatically focuses it (places a cursor into the input field). For the radio group, the first element will be focused. If the input is in the read-only mode, autofocus will not be applied. sortTypeString – ASC or DESC. Applicable to MULTITIERENTRY input type only. validationTypeString – VALIDATE or NO_VALIDATION. Applicable to MULTITIERENTRY input type only. hideAddButtonBoolean – Set to trueto hide the "Add" button, including the "Duplicate” icon displayed next to each item. Applicable to INPUTMATRIX input type only.hideRemoveButtonBoolean – Set to trueto hide the "Remove" button. Applicable to INPUTMATRIX input type only.canModifyRowsBoolean – Set to falseto hide "Add" and "Remove" buttons. Applicable to INPUTMATRIX input type only.readOnlyColumnsSpecifies columns (as a list) that are set as read only. Applicable to INPUTMATRIX input type only. noCellRefreshBoolean – Prevents the Configurator refresh when the value of the Input Matrix cell is edited. Applicable to INPUTMATRIX input type only. defaultHeightNumber that defines the maximum Input Matrix table height. If there are more entries than the defined default height the scroll bar appears. Applicable to INPUTMATRIX input type only. fixTableHeightBoolean that sets the fixed height of the table. Default: true. Applicable to INPUTMATRIX input type within the Configurator only. "enableClientFilter" Allows a user to filter the table by row values. Default: true (the filtering is enabled). Example: cp.setConfigParameter("enableClientFilter", false). Applicable to
InputType.INPUTMATRIXandInputType.CONFIGURATORTABLEinputs type only."enableAdvancedFilter" Allows a user to filter the table by advance filters. Default: false (the filtering is disabled). Example: cp.setConfigParameter("enableAdvancedFilter", false). Applicable to
InputType.INPUTMATRIXandInputType.CONFIGURATORTABLEinputs type only.hiddenColumnsSpecifies table columns (as a list) that are hidden from the user interface. Applicable to INPUTMATRIX input type within the Configurator only. columnValueOptionsSpecifies options for the drop-down menu for the Option column type. Example: cp.setConfigParameter("columnValueOptions", ["column1" : ["Team Leader","Technical Expert","Observer","Member","Critic"]]). Applicable to INPUTMATRIX input type only.columnTypeSets types for the table columns. Example: cp.setConfigParameter("columnType", ["Option","Numeric","Text","Date"]). Applicable to INPUTMATRIX input type only.disableRowSelectionSet to trueto disable the row selection (to hide the check-box). Applicable to INPUTMATRIX input type only.columnLabelsSets column labels. Example: cp.setConfigParameter("columnLabels", ["First Column", "Second Column"])Applicable to INPUTMATRIX input type only.requiredColumnsSets columns a required. Example: cp.setConfigParameter("requiredColumns", ["col1", "col2"])Applicable to INPUTMATRIX input type only."enableInputValueTracking_Previous" Sets the input to previous value trackable. Example: cp.setConfigParameter("enableInputValueTracking_Previous", true).
"enableInputValueTracking_Default" Sets the input to default value trackable. Example: cp.setConfigParameter("enableInputValueTracking_Default", true).
"enableInputValueTracking_ValueChangedByLogic" Sets the input to value change-by-groovy-logic trackable. Example: cp.setConfigParameter("enableInputValueTracking_ValueChangedByLogic", true).
"enableAddActions" turn on/off the ability to add rows in the table (turn on by the default). Example: cp.setConfigParameter("enableAddActions", false).
"preferenceName" set the preference name. Example: cp.setConfigParameter("preferenceName", 'somePreferenceName').
"maxLength" set the maximum length of an input (without validation) for STRINGUSERENTRYandTEXTUSERENTRYinputs.Example: cp.setConfigParameter("maxLength", 4).
"minLength" set the minimum length of an input (without validation) for STRINGUSERENTRYandTEXTUSERENTRYinputs.Example: cp.setConfigParameter("minLength", 2).
Example:
api.getParameter("Discount")?.setConfigParameter("formatType", "PERCENT")- Parameters:
paramName- The name of the configuration option. See the table above.value- The value of the configuration option.- Returns:
- this input
- See Also:
-
clearConfigParameter
Clears the value of a configuration option: sets it tonull.- Parameters:
paramName- The name of the configuration option. SeesetConfigParameter(String, Object).- See Also:
-
getFormattingOptions
Returns the formatting options of the input: the options that influence how the input field looks. SeesetFormattingOption(String, Object)for the options.- Returns:
- the formatting options, as a map of option names and values
- Since:
- 7.0 - Bijou
- See Also:
-
setFormattingOptions
Allows you to set desired formatting options of the input field as a map. For setting a particular formatting option seesetFormattingOption(String, Object).This method replaces all formatting options of the input, including the options set before.
- Parameters:
formattingOptions- The formatting options, as a map of option names and values.- Since:
- 7.0 - Bijou
- See Also:
-
isStoreAuditTrail
Returns whether the logged changes of this input are kept as an audit trail.- Returns:
- the flag set with
setStoreAuditTrail(Boolean) - Since:
- 15.0 - Southside
- See Also:
-
setStoreAuditTrail
Sets whether the logged changes of this input are kept as an audit trail. Applies only to an input whose changes are recorded in the activity log (seesetLogActivity(Boolean)).The activity log is cleaned up automatically. The clean-up deletes the logged input changes of a document when the document is approved, deleted or not changed for 30 days (by default). The changes of an input with this flag set to
trueare not deleted.Example:
api.getParameter("Discount")?.setLogActivity(true)?.setStoreAuditTrail(true)- Parameters:
storeAuditTrail- Set totrueto keep the logged changes of the input.- Returns:
- this input
- Since:
- 15.0 - Southside
- See Also:
-
isLogActivity
Returns whether the changes of this input are recorded in the activity log.- Returns:
- the flag set with
setLogActivity(Boolean) - Since:
- 15.0 - Southside
- See Also:
-
setLogActivity
Sets whether the changes of this input are recorded in the activity log of the document. Applies to Quotes, Agreements/Promotions, Rebate Agreements and Compensation Plans.By default, the changes of inputs generated by a logic are not recorded. The default customer, customer group, product and product group inputs are recorded unless you set this flag to
false.Example:
api.getParameter("Discount")?.setLogActivity(true)- Parameters:
logActivity- Set totrueto record the changes of the input in the activity log.- Returns:
- this input
- Since:
- 15.0 - Southside
- See Also:
-
setFormattingOption
Sets (adds or updates) a formatting option (how the input field is displayed) within the formattingOptions map.Example – creates an input field and sets the placeholder:
Possible values of thedef ce = api.createConfiguratorEntry() cp = ce.createParameter(InputType.STRINGUSERENTRY, "stringInputField") cp.setLabel("String Input Field") cp.setFormattingOption("placeholder","I hold the place")optionNameparameter:optionName Description placeholderSee setPlaceholderText()for more details.defaultWidthSee setDefaultWidth()for more details.widthSee setWidth()for more details.titleSee setTitle()for more details.helpTextSee setHelpText()for more details.helpLinkSee setHelpLink()for more details.customAttributeNameSee setCustomAttributeName()for more details.customAttributeValueSee setCustomAttributeValue()for more details.flexSee setFlex()for more details.- Parameters:
optionName- See the table above.value- The value of the formatting option.- Returns:
- this input
- Since:
- 7.0 - Bijou
- See Also:
-
getAddUnknownValues
Returns the flag set withsetAddUnknownValues(Boolean).- Returns:
- the flag set with
setAddUnknownValues(Boolean) - Since:
- 3.4.4 - Cuba Libre
-
setAddUnknownValues
Sets whether the user can add values that are not among the options of anOPTIONSinput. Only the Classic UI supported this setting.- Parameters:
addUnknownValues- Set totrueto allow values that are not among the options.- Returns:
- this input
- Since:
- 3.4.4 - Cuba Libre
-
getTypedId
Returns the typed ID of the object that the logic runs for, for example the typed ID of the Quote when the Quote is calculated. The server sets it on the inputs that a pricing logic generates.- Returns:
- the typed ID of the object
- See Also:
-
setTypedId
Sets the typed ID returned bygetTypedId().- Parameters:
typedId- The typed ID of the object that the logic runs for.- Returns:
- this input
- Since:
- 3.5 - Salty Dog
-
getAlwaysEditable
Returns whether the input field is always editable.- Returns:
- the flag set with
setAlwaysEditable(Boolean) - Since:
- 3.6 - El Presidente
- See Also:
-
setAlwaysEditable
Sets the input field as always editable. Enables a user to update the input field after the Quote, Agreement/Promotion, Rebate Agreement or Compensation Plan has been submitted. It does not apply to superseded and invalidated documents.Users who cannot edit the input because of
setUserGroupEdit(String)still see it as read-only.Example:
api.getParameter("DeliveryDate")?.setAlwaysEditable(true)- Parameters:
alwaysEditable- Set totrueto set the input field as always editable.- Returns:
- this input
- Since:
- 3.6 - El Presidente
- See Also:
-
addInput
Adds a nested input. This input can be of any type. This is intended to be used when the parent input is of typeInputType.ROWor typeInputType.COLLAPSE. Depending on the parent type, it is also expected that the added input will have a flex attribute.Form logics (Forms 2.0) do not support the
ROWandCOLLAPSEinputs. Arrange the inputs of a form with its layout instead (seeFormLayout).- Parameters:
contextParameter- the input to add- Since:
- 8.0 - Godfather
- See Also:
-
getInputs
Returns the nested inputs of aROWorCOLLAPSEinput.- Returns:
- the inputs added with
addInput(ContextParameter) - Since:
- 8.0 - Godfather
-
getRegisteredFrontendEvents
Returns the frontend events registered for this input withonClick()oronValueChange()of the input builder. The key of the map is the name of the event,onClickoronValueChange. The value holds the settings of the event:- lockInputNames: the names of the inputs that are locked while the event is processed
- excludeInputNames: the names of the inputs whose values are not sent to the server with the event (present only when set)
- Returns:
- the registered events, as a map of event names and event settings
- Since:
- 17.0 - Paloma
- See Also:
-
setRegisteredFrontendEvents
public void setRegisteredFrontendEvents(Map<String, Map<String, List<String>>> registeredFrontendEvents) Not intended for public use. UseonClick()oronValueChange()of the input builder instead. Sets the registered frontend events. Event configs persisted before PFUN-36398 use the legacy "lockInputNames" key, which is renamed to "dependentInputs" so that the frontend only ever sees the current key.- Since:
- 17.0 - Paloma
- See Also:
-
toString
-
setIfNotNull
Not intended for public use.Copy attributes from the original
ContextParameterapart from:name,lookupTableId,type,inputs,valueHint,userGroupEditandregisteredFrontendEvents. Only the attributes that are notnullin the original are copied.- Parameters:
original-ContextParameteras a source for the attributes' copy if not null
-
copyWithoutValue
Not intended for public use.Returns a new input with the name, type, label, lookup table ID, URL, required and read-only flags, parameter group, activity log flags, filter and parameter configuration of this input. The value and the other attributes are not copied.
- Returns:
- the copy of this input without the value
-
update
Not intended for public use.Copies the attributes of another input to this input, including the value. The name, type, label translations, formatting options, nested inputs,
userGroupEditand registered frontend events are not copied. The method does nothing whencpisnullor when its name or type differs from this input. -
equals
-
hashCode
public int hashCode()
-