Calculate distance from post codes

edo906
Member Posts: 7
Hi,
I need to know how to calculate a distance between two postal codes (location table and sales shipment header-ShiptoCity) and know the distance and put it in a field of a custom table. How can I do? In case if I were to use a webservice, how do I implement it on nav?
For nav 2018
Thanks so much
I need to know how to calculate a distance between two postal codes (location table and sales shipment header-ShiptoCity) and know the distance and put it in a field of a custom table. How can I do? In case if I were to use a webservice, how do I implement it on nav?
For nav 2018
Thanks so much
0
Answers
-
you just forgot to ask "how do I become an astronaut, can anyone tell me what I have to do?".
First, yes you will need to locate a WS for this, google a bit:
https://gis.stackexchange.com/questions/15199/looking-for-free-web-service-that-calculates-driving-distance-between-2-addresse/296403
https://developers.google.com/maps/documentation/distance-matrix/overview
I suggest you download postman:
https://www.postman.com/
you will need it to figure out WS calls and make it work.
Once you have this, you "translate this to NAV".
There are several ways to do WS calls to NAV, depending on the version (winhttps, AL...)
"basic" winhttp exampleIF ISCLEAR(WinHTTP) THEN CREATE(WinHTTP,TRUE,TRUE); WinHTTP.Open('POST',T50161."PayPal URL"+'oauth2/token', FALSE); WinHTTP.SetRequestHeader('Accept', 'application/json'); WinHTTP.SetRequestHeader('Accept-Language', 'en_US'); WinHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); WinHTTP.SetRequestHeader('Authorization', STRSUBSTNO('Basic %1', T50161."Base64 Client and Secret")); WinHTTP.Send('grant_type=client_credentials'); vInStream := WinHTTP.ResponseStream; REPEAT vInStream.READTEXT(vtext); vBigT.ADDTEXT(vtext); UNTIL (vInStream.EOS);
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions