Google Map Validation
  • 06 Sep 2024
  • 1 Minute to read
  • Dark
    Light

Google Map Validation

  • Dark
    Light

Article summary

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 nameClassDescription
geojsonStringMap data of the current sales item in the GeoJSON format.
currentSalesItemNodeSalesItemNode Sales item node related to the active object.
salesItemsTreeSalesItemsTree 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.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.