Google Maps - Show in Map / Show Route

ATAT Member Posts: 20
edited 2008-12-18 in NAV Tips & Tricks
I figured out how to show customers adresses in google maps without typing the adress manually in the browser. Just add a button with this code in the on push trigger to the customer card:
HYPERLINK('http://www.google.de/maps?f=q&hl=en&q=' +Address+' '+"Post Code"+' '+City);
For the route to the customer use this:
HYPERLINK('http://www.google.de/maps?f=d&hl=en&saddr=[from street]+[from post code]+[from city]&daddr='
+Address+' '+"Post Code"+' '+City);
In this example i coded the [from] adress in the button what is not the finest art. The option hl=en ist the langage of the user.
It is not a big thing, but sometimes a big help.

Comments

  • krikikriki Member, Moderator Posts: 9,094
    [Topic moved from Navision e-Commerce forum to Navision Tips & Tricks forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • RogerSheetsRogerSheets Member Posts: 15
    Just a quick question on this ...

    So i add a Commandbutton to the form right?

    the only "push" option i see is PushAction with the choices of "Ok, Cancel, LookupOk, LookupCancel, Yes, No, Close, Stop, Formhelp, RunObject, RunSystem, Lookup Table"

    where do i add that code you referred to?
  • ara3nara3n Member Posts: 9,255
    click on the button and then hit F9. This will open the onpush trigger. If your license does not allow development, you won't be able to do it .
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • RogerSheetsRogerSheets Member Posts: 15
    wierd ... we have a developer license (at least i thought we did). I can design reports and use code in them, but not on the form. I'll have to check with our other developer to double check.

    thanks for the help!
  • ara3nara3n Member Posts: 9,255
    There are different granuales for forms and tables, and for reports that you can do development on.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    wierd ... we have a developer license (at least i thought we did). I can design reports and use code in them, but not on the form. I'll have to check with our other developer to double check.

    thanks for the help!
    It means that you have just report designer. It is the base level of developer license. You need Application builder granule to be able to edit C/AL on forms, tables and codeunits.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • postacipostaci Member Posts: 116
    AT wrote:
    I figured out how to show customers adresses in google maps without typing the adress manually in the browser. Just add a button with this code in the on push trigger to the customer card:
    HYPERLINK('http://www.google.de/maps?f=q&hl=en&q=' +Address+' '+"Post Code"+' '+City);
    
    For the route to the customer use this:
    HYPERLINK('http://www.google.de/maps?f=d&hl=en&saddr=[from street]+[from post code]+[from city]&daddr='
    +Address+' '+"Post Code"+' '+City);
    
    In this example i coded the [from] adress in the button what is not the finest art. The option hl=en ist the langage of the user.
    It is not a big thing, but sometimes a big help.


    HI,

    I am trying to do this.
    I created another 3 fields in Contacts.
    1. Routeadres text 30
    2. Routepostcode code 20
    3. Routestad text 30

    Everyone can fill this in. This must be the homeadres.
    So it must be like ?:
    HYPERLINK('http://www.google.de/maps?f=d&hl=en&saddr=[routeadres]+[routepostcode]+[routestad]&daddr='
    +Address+' '+"Post Code"+' '+City)

    But this doesn't work. second half works but FROM adress doesn't work.
    How Can I fix this ??
    :-k
  • kinekine Member Posts: 12,562
    what about using " " around the string, because the string includes spaces? Or instead spaces you can use "%20"
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jmjm Member Posts: 156
    Hi,

    have a look at this code example:
    ContactStart.GET('KT000145');
    
    ContactEnd.GET('KT000003');
    
    HYPERLINK(
      'http://www.google.de/maps?f=d&hl=en&saddr='+
      ContactStart.Address+','+
      ContactStart."Post Code"+','+
      ContactStart.City+
      '&daddr='+
      ContactEnd.Address+','+
      ContactEnd."Post Code"+','+
      ContactEnd.City);
    

    And just to have al little fun with google maps try this:[code]
    http://www.google.de/maps?f=d&hl=en&saddr=München&daddr=New%20York
    Especially No. 38 in the list on the left side is verry interesting.
    br
    Josef Metz
  • postacipostaci Member Posts: 116
    Hi,

    I already solved it. \:D/


    HYPERLINK('http://www.google.nl/maps?f=d&hl=en&saddr='+Routeadres+' '+Routepostcode+' '+Routestad+'&daddr='
    +Address+' '+"Post Code"+' '+City);

    I just forget some quotes. That's all !!

    ooh yeahhhhhh ! =D>
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Here you can figure out which parameters are possible and what is their meaning.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.