Google Map Validation

Purpose

Allows you to run a script to validate the Google Maps content for a sales item.

Setup

Upload the script for Validate Google Map Script.

For details about uploading and configuring Groovy scripts, read Upload a Groovy script.

Binding variables

In addition to the common binding variables, the following binding variables are available for this extension point.

Variable name Class Description
geojson String Map data of the current sales item in the GeoJSON format.
currentSalesItemNode SalesItemNode Sales item node related to the active object.
salesItemsTree SalesItemsTree Represents the quote. Contains functions you can use to query and modify the quote and its line items.

Expected output

Boolean value indicating whether the map is saved:

  • True—Map content is valid, and the map is saved.
  • False—Map content validation encountered an error, and the map isn't saved. A user receives a notification indicating that the map couldn't be saved. The script can also display a notification indicating what caused the error.

Script execution

The script uploaded for this extension point is run automatically in the following cases:

  • When a user selects Save in the Google Maps pop-up window.
  • When a user selects Submit in the snapshot pop-up window.

Use this script only to perform validations. Changes to the geojson, salesItemsTree, or currentSalesItemNode binding variables will be ignored.

Note

The script is not triggered when you modify the map using other Groovy scripts through the SalesItemNode.setGeojson() method. The other script should only insert valid GeoJSON values and perform necessary validations.