This Extension Point allows a script implementation to be provided for validating a sales item’s Google Map content.
Initial Setup
Upload the script file to the Groovy Script with the name “Validate Google Map Script". Please refer to Groovy Service Introduction - Uploading a New Groovy Script for more details of how to do this.
Additional Binding Variables
The following binding variable(s) are made available for this extension point, in addition to the common binding variables listed in Groovy Service Introduction - Common Binding Variables.
Variable Name |
Class |
Description |
---|---|---|
geojson |
String |
The map data of the current Sales Item, in GeoJSON format. |
currentSalesItemNode |
SalesItemNode |
The SalesItemNode related to the active object. |
SalesitemTree |
SalesItemsTree |
Represents the Quote, it contains the functions that can be used to query the quote and its line items data. |
Expected Output
A boolean value. If the value is false, it means that that validation has failed, and the map will not be saved. If the value is true, it means that the map content is valid and will be saved.
Script Execution
The script that has been uploaded for this extension point will be executed automatically when the user clicks on the Save button on the Google Map pop-up window or when the user clicks on the Submit button on the snapshot pop-up window.
If the script returns false, there will be a notification saying that the map has not been saved yet. The script can also output error notifications of its own, to let the end users know what exactly the problem is.
This extension point should only be used to perform validations, not to make further changes. Any changes made to the geojson, salesItemsTree, or currentSalesItemNode binding variables will be ignored.
Note that this script will not be triggered when the map is changed through the use of other types of groovy script, through the use of SalesItemNode.setGeojson() method. That other script is assumed to only insert valid GeoJSON, and to have taken care of any validation necessary.
Comments
0 comments
Article is closed for comments.