- 11 Sep 2024
- 2 Minutes to read
- Print
- DarkLight
On Configuration Exits
- Updated on 11 Sep 2024
- 2 Minutes to read
- Print
- DarkLight
Purpose
Allows you to run a script for the purposes described below.
Purpose | Details |
---|---|
Prevent the configuration page from closing | If the script uploaded for this extension point returns the true value, users can close the configurator page in the UI. If the script returns the false value, users can't close the configurator page. |
Execute a BOM explosion based on the lookup table and conditions defined in the script | BOM explosion can be executed through the Groovy script based on the custom conditions defined in it. |
Replace a configurable product with matching classified products | The script uploaded for this extension point allows you to use the presubmit check engine to find matching classified products. If only one matching classified product is found, you can replace the configurable product with it. |
Setup
Upload the script for Groovy script to trigger when configuration page exits.
For details about uploading and configuring Groovy scripts, read Upload a Groovy script.
If you can't find Groovy script to trigger when configuration page exits, follow these steps to add it to the list of scripts:
- From the application left navigation area, select Administration.
- From the top navigation bar, select Operation Settings.
- Select the System Settings tab.
- Under Load Schema, select Start.
Binding variables
In addition to the common binding variables, the following binding variables are available for this extension point.
Variable name | Class | Description |
---|---|---|
currentSalesItemNode | SalesItemNode | Sales item node related to the configuration page that a user wants to close. |
salesItemsTree | SalesItemsTree | Represents the quote. Contains functions you can use to query and modify the quote and its line items. |
preSubmitCheckEngine | PreSubmitCheckEngine | Represents the presubmit check engine that allows users to find matching classified products and replace a configurable product with them. |
Expected output
Boolean value indicating whether a user can close the configurator page:
- True—Configurator page can be closed.
- False—Configurator page can't be closed.
Conditions to return the true or false value depend on the system usage. Examples of such conditions include the following:
- All required fields on the configurator page are filled in.
- Results of referencing a lookup table based on a specific data point in the quote.
Along with the expected output, you can also send warning messages to the UI. For example, in case of product replacement, you can write a script that will generate a warning if multiple matching products exist for the configurable product.
Script execution
The script uploaded for this extension point is run automatically when users make changes on the configurator page, such as:
- Select another tab within the same configurable item
- Select another line item or quote header
- Select the back button to go to the line items table
- Select another menu item
- Reload the quote page
- Select Save the quote in the configurator
These actions trigger the triggerGroovyScriptOnConfigurationExits API to execute the Groovy script.