web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Pass Google Map event back to the control

(0) ShareShare
ReportReport
Posted on by 85

Hi, 

I'm using extensible control to load Google Map and add markers there reflecting planned activities. 

Is it possible to somehow pass information about clicked marker back to the calling control? E.g. if users

clicks marker "A1" on the map then at least the label should be passed on, so activity "A1" could

be opened. 

I have the same question (0)
  • luksz Profile Picture
    85 on at
    RE: Pass Google Map event back to the control

    Yes, it worked! Thanks a lot.

  • Verified answer
    Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Pass Google Map event back to the control

    You can either set properties of your control, or you can call an X++ method from Javascript. Such method must be decorated with FormCommand attribute and there are some extra requirements for it. Refer to Extensible control programming reference > Runtime: FormCommandAttribute for more details.

  • luksz Profile Picture
    85 on at
    RE: Pass Google Map event back to the control

    Hi Judy,

    It's clear what you suggested, but I think we're still in realm of the Map. The question is - how can I pass information with the label back to D365 and use it - e.g. save it in a table or run some action.

  • Suggested answer
    huijij Profile Picture
    19,811 on at
    RE: Pass Google Map event back to the control

    Hi luksz,

    The google.maps.Marker object can listen to click event, you can adds a label to the marker. A marker label is a letter or number that appears inside a marker.

    The method getLabel() to get the label of the Marker.

    You may check Maps JavaScript API Reference which Events are listed in a separate section for each object which contains events. You can edit the test map effect:

    developers.google.com/.../events

  • luksz Profile Picture
    85 on at
    RE: Pass Google Map event back to the control

    I've already studied his posts. Unfortunately there is nothing mentioned about getting data back from the map. There is actually similar question by Irena, but it wasn't answered. I'm not too proficient in JS, so I'm trying to find something by trial and error, but I'm not sure if it's actually possible.

  • André Arnaud de Calavon Profile Picture
    297,316 Super User 2025 Season 2 on at
    RE: Pass Google Map event back to the control

    Hi Luksz,

    Martin Drab wrote a blog about extensible controls before. In his example he used Google Maps. He didn't write about your requirement, but the blog might give some hints and links: Extensible control – HTML/JavaScript – Goshoom.NET Dev Blog

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 745 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 597 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 580 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans