Configuration Wizards Admin

In this section, you can set up a configuration wizard, which assists users with handling complex data configuration tasks. The UI part is the same as any Configurator where users provide input for several parameters with cascading dependencies. The advantage of a Configuration Wizard is that it can take the user inputs and further work with the data, for example, write to Company Parameters or Product tables.

The Configurator Wizard can also be a convenient way to allow users to modify data tables without giving them the required user privileges. Users will not be able to modify data directly but could do so in a controlled way using the wizard – no permissions are required but users can only modify what the wizard allows them.

Configuration Wizards can be accessed from the Module > Company Processes menu or can be embedded as a tab in standalone Custom Forms or Actions.

Create Configuration Wizard

To create a Configuration Wizard, do the following:

  1. Define two generic calculation logics:

    • Configuration Wizard logic – This logic defines the configurator UI with user inputs. See the Interactive Forms - Configurators section for details.

    • Execution logic – Retrieves the inputs from the configurator and executes the programmed actions (e.g., writes to Company Parameter tables or to Product Master).

  2. Go to Administration > Configuration > Configuration Wizards Admin and add a new wizard.

  3. Select the previously created logics.

  4. You can limit the availability of the wizard to specific user groups.
    The new Configuration Wizard will appear under the Company Processes menu.

Example:

In this very simple example, we will show how user inputs are configured, the values entered by the user retrieved and a Product record updated.

Let's start with the wizard logic – the first element defines a user entry, where the user selects a product.

Groovy
def cep = api.createConfiguratorEntry(InputType.PRODUCT, "Product")
return cep

In the second element, the label of the selected product is retrieved and pre-filled in the Label field. The user is supposed to change the label.

Groovy
def productSku =  input.Product

if( !productSku ){
  def ce = api.createConfiguratorEntry()
  ce.setMessage("<div style='margin:20px;color:red;'>Please select Product</div>")
  return false
}

def descr = api.product("label", productSku)

def ced = api.createConfiguratorEntry(InputType.STRINGUSERENTRY, "Label")
ced.getFirstInput().setValue(descr)

return ced

In the execution logic, the user inputs defined by the wizard logic and filled in by the user are retrieved ('Product' and 'Label') and the Label value for the specified Sku is written to the Products table:

Groovy
def sku =  input.Product
def label =  input.Label
api.logInfo("Configurator Wizard Runner: sku", sku)
api.logInfo("Configurator Wizard Runner: label", label)

if( !sku ){
  api.logInfo("Configurator Wizard Runner: SKU is missing!", "")
  return false
}
if( !label ){
  api.logInfo("Configurator Wizard Runner: Label is missing!", "")
  return false
}

api.update("P", ["sku" : sku,"label" : label])

Further settings:

  • You can also add custom buttons to the wizard to allow users to perform various actions.

    The possible actions include:

    • recalculate configurator

    • open a document (Manual Price List, Quote, etc.)

    • execute the execution formula

    • clear and reset

    • close the configurator

    • open a web link in a new tab

    • launch a configuration wizard

    Groovy
    def ce = api.createConfiguratorEntry(InputType.BUTTON,"Next Step") //Create a button
    ce.setHiddenActions(InputButtonAction.ALL) //Hide all default action buttons. You can also hide only selected buttons: (InputButtonAction.CLEAR, InputButtonAction.RESET)
    ce.getFirstInput().setLabel("*Next Step")
    ce.getFirstInput().setLabelTranslations('{"en":"EN", "de":"DE"}') //Allows to select the language version
    ce.getFirstInput().setValueOptions(["3", "2", "1"])
    
    //You can assign one of the default actions to a custom button:
    ce.createParameter(InputType.BUTTON, "Cancel")
    ce.inputs[idx].setLabel("Cancel")
    ce.inputs[idx].setValue(InputButtonAction.CANCEL)
    
    //Button to open a web link. The target page is opened in a new browser tab.
    ce.createParameter(InputType.BUTTON, "Pricefx")
    ce.inputs[idx].setLabel("Pricefx")
    ce.inputs[idx].setURL("http://www.pricefx.com")
    //you can also point to a page in the Pricefx app: ce.inputs[idx].setURL("priceFxWeb.html?targetPage=rebateAgreementsPage&targetPageState=${ra-"R-"}.RBA")
    
    //Button to open a previously selected Rebate Agreement:
    def ra =  input."Rebate Agreement"
    ce.createParameter(InputType.BUTTON, "RA")
      api.logInfo("ra", ra)
      ce.inputs[idx].setLabel("Open ${ra}")
      ce.inputs[idx].addParameterConfigEntry("targetPage" ,"rebateAgreementsPage")
      ce.inputs[idx].addParameterConfigEntry("targetPageState" ,"${ra-"R-"}.RBA")
    
  • Results of the execution logic can be displayed directly in the wizard dialog (they are rendered as read only):

    Groovy
    def matrix =  input."Configuration Attributes" //the inputs are passed from wizard logic
    def clusterName =  input.ClusterName
    
    api.logInfo("matrix", matrix)
    
    def ce = api.createConfiguratorEntry()
    
    ce.setMessage("Cluster ${clusterName} was crated")
    return ce;