Show map on contact record

Hello all,


I am trying to use the show on map function from the contact section page and add it to the actions on the contact record page.

I have added the function to the page schema and added it to the actions menu. However, when I load the page, the button works and displays the map but it doesn't display the caption string on the button. 

Though oddly, when I reload the page, the string appears but the map then won't load.


What could be causing this?

Like 0



Hello Kevin,


Caption is not displayed since once the edit page is reviewed in combined mode then localizable values are being received from the section schema. To resolve this problem you need to:


1) Add the same localizable value to the ContactSectionV2 schema as on the ContactPageV2 schema

2) Add this part of code to the contact page schema:


define("ContactPageV2",["ContactPageV2Resources", "MapsHelper", "MapsUtilities"],
        function(resources, MapsHelper, MapsUtilities){
        messages: {
            "GetMapsConfig": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.SUBSCRIBE
            getActions: function() {
                var actionMenuItems = this.callParent(arguments);
                    "Tag": "showOnMap",
                    "Click": {"bindTo": "openShowOnMap"},
                    "Caption": {"bindTo": "Resources.Strings.ShowOnMapCaption"},
                    "Visible": true
                return actionMenuItems;
            showOnMap: function(schemaName, items, callback) {
                var config = config || {};
                items = items || this.getesqedItems();
                var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                    rootSchemaName: "ContactAddress"
                esq.addColumn(schemaName + ".Name");
                esq.filters.addItem(this.Terrasoft.createColumnInFilterWithParameters(schemaName, items));
                esq.getEntityCollection(function(result) {
                    var addresses = result.collection;
                    if (result.success && !addresses.isEmpty()) {
                        var mapsData = [];
                        var mapsConfig = {
                            mapsData: mapsData
                        addresses.each(function(item) {
                            var addressType = item.get("AddressType").displayValue;
                            var address =;
                            var content = this.Ext.String.format("<h2>{0}</h2><div>{1}</div>", addressType, address);
                            var dataItem = {
                                caption: addressType,
                                content: content,
                                address: address,
                                gpsE: item.get(config.columnNameLongitude),
                                gpsN: item.get(config.columnNameLatitude)
                        }, this);
              , mapsConfig);
                    } else {
                }, this);
            openShowOnMap: function() {
                var items = [];
      , this.entitySchemaName, items, function(mapsConfig) {
                        scope: this,
                        mapsConfig: mapsConfig



3) Add the EmptyAddressDetailMessage localizable string to the ContactPageV2 schema


Best regards,


Show all comments